diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3fae3a5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,162 @@ +# Compiled source # +################### +*.class +*.dll +*.exe +*.o +*.so + +sb + +build +data +pkg +bin +_obj + +main + +test_node + +*~ +client +lib/skyapi/target +# Packages # +############ +# it's better to unpack these files and commit the raw source +# git has its own built in compression methods +*.7z +*.dmg +*.gz +*.iso +*.jar +*.rar +*.tar +*.zip + +# Logs and databases # +###################### +*.log +*.sql +*.sqlite + +# OS generated files # +###################### +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +Icon? +ehthumbs.db +Thumbs.db + +*.pyx +#build +*~ + +*.orig + +.cache +release +.bin + +.skycoin + +*.prof +*.out + +# Binaries +/skycoind +/skycoin +/skycoindev +/blockchain +/generate_cert +/address_gen +/skycoin-integration + +*.pem + +# Deprecated +_deprecated/ + +blockchain.bin +blockchain.sigs +master.keys +*.bak +benefactor-wallet.json +masterdata/ +.genv + +src/gui/static/dev +src/mesh/gui/static/dev + +npm-debug.log + +node_modules + +electron/release +electron/.cache +electron/.electron_cache +electron/node_modules +electron/.gox_output +electron/.electron_output +electron/.standalone_output +electron/.daemon_output +electron/.cli_output +# Do not ignore the icons folder +!electron/build +!electron/build/icons + +.vscode/ + +#File generation sublime text +.do.cfg +.do.state +skycoin.do + +*.swo +*.swp + +src/mesh/TODO + +.idea/ + +*.iml +*.test +coverage.html +coverage/ +*.coverage.out + +src/api/integration/wallets/ +src/api/integration/wallets/ + +skycoin-cli + +# FIXME: see #1027 - Temporary solution to deal with generated file +include/libskycoin.h + +# Eclipse temp files +.cproject +.metadata/** +.project + +# Generated docs +docs/libc/latex +docs/libc/man +docs/libc/xml + + +# Do not ignore Docker Cloud build +!hooks/build + +*.prof +*.profile +*.cpuprofile +*.memprofile + +# cli fiberAddressGen default output +addresses.txt +seeds.csv + +histogram diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f5cdcd2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: java +jdk: +- oraclejdk11 + +script: + - make install + - make test-ci diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a25b899 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,19 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## Libskycoin-Android 0.25.1 - 2019/03/19 + +### Added + +- Add `skyapi`, a wrapper for Skycoin api in version 0.25.1 + +### Fixed + +- Fix #5 - Android API wrapper for the Skycoin node API + + + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fbbc8a1 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +install: + (cd lib/skyapi && mvn clean install) + +test-ci: + (cd lib/skyapi && mvn test) diff --git a/README.md b/README.md new file mode 100644 index 0000000..0b5e36b --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +## Skyapi, a Wrapper for Skycoin Api + +This wrapper is Auto generated by openapi-generator directly from `Skycoin Api` code for version v0.25.1. + +For further details of usage of `Skyapi wrapper for Skycoin Api` see [Autogenerated documentation](./lib/skyapi/README.md) + +### Specific Node Address + +For use a specific node of Skycoin, you just need to create a instance of `DefaultApi` passing the node address: + +```android +DefaultApi api_instance = new DefaultApi(); +api_instance.setBasePath("some_host"); +``` + +Then in `skyapi` you can use all methods related to Api Client. \ No newline at end of file diff --git a/docker/images/dev-cli/Dockerfile b/docker/images/dev-cli/Dockerfile new file mode 100644 index 0000000..34cd05b --- /dev/null +++ b/docker/images/dev-cli/Dockerfile @@ -0,0 +1,8 @@ +FROM dock9/oraclejdk8:gradle-4.6 + +WORKDIR /usr/src/skyapi + +COPY ./lib/skyapi . + +RUN mvn clean install + diff --git a/lib/skyapi/.gitignore b/lib/skyapi/.gitignore new file mode 100644 index 0000000..a836875 --- /dev/null +++ b/lib/skyapi/.gitignore @@ -0,0 +1,39 @@ +# Built application files +*.apk +*.ap_ + +# Files for the Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +# Intellij +*.iml + +# Keystore files +*.jks diff --git a/lib/skyapi/.openapi-generator-ignore b/lib/skyapi/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/lib/skyapi/.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/.openapi-generator/VERSION b/lib/skyapi/.openapi-generator/VERSION new file mode 100644 index 0000000..2c6109e --- /dev/null +++ b/lib/skyapi/.openapi-generator/VERSION @@ -0,0 +1 @@ +3.3.4 \ No newline at end of file diff --git a/lib/skyapi/README.md b/lib/skyapi/README.md new file mode 100644 index 0000000..e694b71 --- /dev/null +++ b/lib/skyapi/README.md @@ -0,0 +1,180 @@ +# skyapi + +## Requirements + +Building the API client library requires [Maven](https://maven.apache.org/) to be installed. + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn deploy +``` + +Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + Skycoin + skyapi + v0.25.1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "Skycoin:skyapi:v0.25.1" +``` + +### Others + +At first generate the JAR by executing: + + mvn package + +Then manually install the following JARs: + +* target/skyapi-v0.25.1.jar +* target/lib/*.jar + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import skycoin.DefaultApi; + +public class DefaultApiExample { + + public static void main(String[] args) { + DefaultApi apiInstance = new DefaultApi(); + try { + Object result = apiInstance.addressCount(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#addressCount"); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://127.0.0.1:6420* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**addressCount**](docs/DefaultApi.md#addressCount) | **GET** /api/v1/addresscount | Returns the total number of unique address that have coins. +*DefaultApi* | [**addressUxouts**](docs/DefaultApi.md#addressUxouts) | **GET** /api/v1/address_uxouts | +*DefaultApi* | [**balanceGet**](docs/DefaultApi.md#balanceGet) | **GET** /api/v1/balance | Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. +*DefaultApi* | [**balancePost**](docs/DefaultApi.md#balancePost) | **POST** /api/v1/balance | Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. +*DefaultApi* | [**block**](docs/DefaultApi.md#block) | **GET** /api/v1/block | +*DefaultApi* | [**blockchainMetadata**](docs/DefaultApi.md#blockchainMetadata) | **GET** /api/v1/blockchain/metadata | Returns the blockchain metadata. +*DefaultApi* | [**blockchainProgress**](docs/DefaultApi.md#blockchainProgress) | **GET** /api/v1/blockchain/progress | Returns the blockchain sync progress. +*DefaultApi* | [**blocksGet**](docs/DefaultApi.md#blocksGet) | **GET** /api/v1/blocks | blocksHandler returns blocks between a start and end point, +*DefaultApi* | [**blocksPost**](docs/DefaultApi.md#blocksPost) | **POST** /api/v1/blocks | blocksHandler returns blocks between a start and end point, +*DefaultApi* | [**coinSupply**](docs/DefaultApi.md#coinSupply) | **GET** /api/v1/coinSupply | +*DefaultApi* | [**csrf**](docs/DefaultApi.md#csrf) | **GET** /api/v1/csrf | Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. +*DefaultApi* | [**defaultConnections**](docs/DefaultApi.md#defaultConnections) | **GET** /api/v1/network/defaultConnections | defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. +*DefaultApi* | [**explorerAddress**](docs/DefaultApi.md#explorerAddress) | **GET** /api/v1/explorer/address | +*DefaultApi* | [**health**](docs/DefaultApi.md#health) | **GET** /api/v1/health | Returns node health data. +*DefaultApi* | [**lastBlocks**](docs/DefaultApi.md#lastBlocks) | **GET** /api/v1/last_blocks | +*DefaultApi* | [**networkConnection**](docs/DefaultApi.md#networkConnection) | **GET** /api/v1/network/connection | This endpoint returns a specific connection. +*DefaultApi* | [**networkConnections**](docs/DefaultApi.md#networkConnections) | **GET** /api/v1/network/connections | This endpoint returns all outgoings connections. +*DefaultApi* | [**networkConnectionsDisconnect**](docs/DefaultApi.md#networkConnectionsDisconnect) | **POST** /api/v1/network/connection/disconnect | +*DefaultApi* | [**networkConnectionsExchange**](docs/DefaultApi.md#networkConnectionsExchange) | **GET** /api/v1/network/connections/exchange | +*DefaultApi* | [**networkConnectionsTrust**](docs/DefaultApi.md#networkConnectionsTrust) | **GET** /api/v1/network/connections/trust | 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. +*DefaultApi* | [**outputsGet**](docs/DefaultApi.md#outputsGet) | **GET** /api/v1/outputs | 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. +*DefaultApi* | [**outputsPost**](docs/DefaultApi.md#outputsPost) | **POST** /api/v1/outputs | 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. +*DefaultApi* | [**pendingTxs**](docs/DefaultApi.md#pendingTxs) | **GET** /api/v1/pendingTxs | +*DefaultApi* | [**resendUnconfirmedTxns**](docs/DefaultApi.md#resendUnconfirmedTxns) | **POST** /api/v1/resendUnconfirmedTxns | +*DefaultApi* | [**richlist**](docs/DefaultApi.md#richlist) | **GET** /api/v1/richlist | Returns the top skycoin holders. +*DefaultApi* | [**transaction**](docs/DefaultApi.md#transaction) | **GET** /api/v1/transaction | +*DefaultApi* | [**transactionInject**](docs/DefaultApi.md#transactionInject) | **POST** /api/v2/transaction/inject | Broadcast a hex-encoded, serialized transaction to the network. +*DefaultApi* | [**transactionRaw**](docs/DefaultApi.md#transactionRaw) | **GET** /api/v2/transaction/raw | Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. +*DefaultApi* | [**transactionVerify**](docs/DefaultApi.md#transactionVerify) | **POST** /api/v2/transaction/verify | +*DefaultApi* | [**transactionsGet**](docs/DefaultApi.md#transactionsGet) | **GET** /api/v1/transactions | Returns transactions that match the filters. +*DefaultApi* | [**transactionsPost**](docs/DefaultApi.md#transactionsPost) | **POST** /api/v1/transactions | Returns transactions that match the filters. +*DefaultApi* | [**uxout**](docs/DefaultApi.md#uxout) | **GET** /api/v1/uxout | Returns an unspent output by ID. +*DefaultApi* | [**verifyAddress**](docs/DefaultApi.md#verifyAddress) | **POST** /api/v2/address/verify | Verifies a Skycoin address. +*DefaultApi* | [**version**](docs/DefaultApi.md#version) | **GET** /api/v1/version | +*DefaultApi* | [**wallet**](docs/DefaultApi.md#wallet) | **GET** /api/v1/wallet | Returns a wallet by id. +*DefaultApi* | [**walletBalance**](docs/DefaultApi.md#walletBalance) | **GET** /api/v1/wallet/balance | Returns the wallet's balance, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. +*DefaultApi* | [**walletCreate**](docs/DefaultApi.md#walletCreate) | **POST** /api/v1/wallet/create | +*DefaultApi* | [**walletDecrypt**](docs/DefaultApi.md#walletDecrypt) | **POST** /api/v1/wallet/decrypt | Decrypts wallet. +*DefaultApi* | [**walletEncrypt**](docs/DefaultApi.md#walletEncrypt) | **POST** /api/v1/wallet/encrypt | Encrypt wallet. +*DefaultApi* | [**walletFolder**](docs/DefaultApi.md#walletFolder) | **GET** /api/v1/wallets/folderName | +*DefaultApi* | [**walletNewAddress**](docs/DefaultApi.md#walletNewAddress) | **POST** /api/v1/wallet/newAddress | +*DefaultApi* | [**walletNewSeed**](docs/DefaultApi.md#walletNewSeed) | **GET** /api/v1/wallet/newSeed | +*DefaultApi* | [**walletRecover**](docs/DefaultApi.md#walletRecover) | **POST** /api/v2/wallet/recover | 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. +*DefaultApi* | [**walletSeed**](docs/DefaultApi.md#walletSeed) | **POST** /api/v1/wallet/seed | This endpoint only works for encrypted wallets. If the wallet is unencrypted, The seed will be not returned. +*DefaultApi* | [**walletSeedVerify**](docs/DefaultApi.md#walletSeedVerify) | **POST** /api/v2/wallet/seed/verify | Verifies a wallet seed. +*DefaultApi* | [**walletSpent**](docs/DefaultApi.md#walletSpent) | **POST** /api/v1/wallet/spend | +*DefaultApi* | [**walletTransaction**](docs/DefaultApi.md#walletTransaction) | **POST** /api/v1/wallet/transaction | +*DefaultApi* | [**walletTransactions**](docs/DefaultApi.md#walletTransactions) | **GET** /api/v1/wallet/transactions | +*DefaultApi* | [**walletUnload**](docs/DefaultApi.md#walletUnload) | **POST** /api/v1/wallet/unload | Unloads wallet from the wallet service. +*DefaultApi* | [**walletUpdate**](docs/DefaultApi.md#walletUpdate) | **POST** /api/v1/wallet/update | Update the wallet. +*DefaultApi* | [**wallets**](docs/DefaultApi.md#wallets) | **GET** /api/v1/wallets | + + +## Documentation for Models + + - [Apiv1exploreraddressInputs](docs/Apiv1exploreraddressInputs.md) + - [Apiv1exploreraddressOutputs](docs/Apiv1exploreraddressOutputs.md) + - [Apiv1exploreraddressStatus](docs/Apiv1exploreraddressStatus.md) + - [Apiv1pendingTxsTransaction](docs/Apiv1pendingTxsTransaction.md) + - [Apiv1walletsEntries](docs/Apiv1walletsEntries.md) + - [Apiv1walletsMeta](docs/Apiv1walletsMeta.md) + - [Apiv1wallettransactionHoursSelection](docs/Apiv1wallettransactionHoursSelection.md) + - [Apiv1wallettransactionTo](docs/Apiv1wallettransactionTo.md) + - [Apiv1wallettransactionWallet](docs/Apiv1wallettransactionWallet.md) + - [InlineObject](docs/InlineObject.md) + - [InlineResponse200](docs/InlineResponse200.md) + - [InlineResponse2001](docs/InlineResponse2001.md) + - [InlineResponse2002](docs/InlineResponse2002.md) + - [InlineResponse2003](docs/InlineResponse2003.md) + - [InlineResponse2003UnconfirmedVerifyTransaction](docs/InlineResponse2003UnconfirmedVerifyTransaction.md) + - [InlineResponse2004](docs/InlineResponse2004.md) + - [InlineResponse2005](docs/InlineResponse2005.md) + - [InlineResponse2006](docs/InlineResponse2006.md) + - [InlineResponse2007](docs/InlineResponse2007.md) + - [InlineResponse2007Data](docs/InlineResponse2007Data.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) + + +## Documentation for Authorization + +Authentication schemes defined for the API: +### csrfAuth + +- **Type**: API key +- **API key parameter name**: X-CSRF-TOKEN +- **Location**: HTTP header + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + +skycoin.doe@example.com + diff --git a/lib/skyapi/build.gradle b/lib/skyapi/build.gradle new file mode 100644 index 0000000..ed01e90 --- /dev/null +++ b/lib/skyapi/build.gradle @@ -0,0 +1,96 @@ +group = 'Skycoin' +project.version = 'v0.25.1' + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + } +} + +allprojects { + repositories { + jcenter() + } +} + + +apply plugin: 'com.android.library' +apply plugin: 'com.github.dcendents.android-maven' + +android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + testOptions { + unitTests.returnDefaultValues = true + } +} + + +ext { + swagger_annotations_version = "1.5.0" + gson_version = "2.3.1" + httpmime_version = "4.5.2" + httpcore_version = "4.4.4" + httpclient_version = "4.3.3" + volley_version = "1.0.0" + junit_version = "4.12" + robolectric_version = "3.0" + concurrent_unit_version = "0.4.2" +} + +dependencies { + compile "io.swagger:swagger-annotations:$swagger_annotations_version" + compile "com.google.code.gson:gson:$gson_version" + compile "org.apache.httpcomponents:httpcore:$httpcore_version" + compile "org.apache.httpcomponents:httpmime:$httpmime_version" + compile "org.apache.httpcomponents:httpclient-android:$httpclient_version" + compile "com.android.volley:volley:${volley_version}" + testCompile "junit:junit:$junit_version" + testCompile "org.robolectric:robolectric:${robolectric_version}" + testCompile "net.jodah:concurrentunit:${concurrent_unit_version}" +} + +afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } +} + +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +artifacts { + archives sourcesJar +} diff --git a/lib/skyapi/docs/Apiv1exploreraddressInputs.md b/lib/skyapi/docs/Apiv1exploreraddressInputs.md new file mode 100644 index 0000000..104044a --- /dev/null +++ b/lib/skyapi/docs/Apiv1exploreraddressInputs.md @@ -0,0 +1,14 @@ + +# Apiv1exploreraddressInputs + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**owner** | **String** | | [optional] +**hours** | **Long** | | [optional] +**calculatedHours** | **Long** | | [optional] +**coins** | **String** | | [optional] +**uxid** | **String** | | [optional] + + + diff --git a/lib/skyapi/docs/Apiv1exploreraddressOutputs.md b/lib/skyapi/docs/Apiv1exploreraddressOutputs.md new file mode 100644 index 0000000..f29e59c --- /dev/null +++ b/lib/skyapi/docs/Apiv1exploreraddressOutputs.md @@ -0,0 +1,13 @@ + +# Apiv1exploreraddressOutputs + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hours** | **Long** | | [optional] +**dst** | **String** | | [optional] +**coins** | **String** | | [optional] +**uxid** | **String** | | [optional] + + + diff --git a/lib/skyapi/docs/Apiv1exploreraddressStatus.md b/lib/skyapi/docs/Apiv1exploreraddressStatus.md new file mode 100644 index 0000000..4053bae --- /dev/null +++ b/lib/skyapi/docs/Apiv1exploreraddressStatus.md @@ -0,0 +1,13 @@ + +# Apiv1exploreraddressStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**unconfirmed** | **Boolean** | | [optional] +**blockSeq** | **Long** | | [optional] +**label** | **Long** | | [optional] +**confirmed** | **Boolean** | | [optional] + + + diff --git a/lib/skyapi/docs/Apiv1pendingTxsTransaction.md b/lib/skyapi/docs/Apiv1pendingTxsTransaction.md new file mode 100644 index 0000000..225536c --- /dev/null +++ b/lib/skyapi/docs/Apiv1pendingTxsTransaction.md @@ -0,0 +1,17 @@ + +# Apiv1pendingTxsTransaction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**outputs** | [**List<Apiv1exploreraddressOutputs>**](Apiv1exploreraddressOutputs.md) | | [optional] +**innerHash** | **String** | | [optional] +**inputs** | **List<String>** | | [optional] +**sigs** | **List<String>** | | [optional] +**length** | **Integer** | | [optional] +**txid** | **String** | | [optional] +**type** | **Integer** | | [optional] +**timestamp** | **Integer** | | [optional] + + + diff --git a/lib/skyapi/docs/Apiv1walletsEntries.md b/lib/skyapi/docs/Apiv1walletsEntries.md new file mode 100644 index 0000000..03402be --- /dev/null +++ b/lib/skyapi/docs/Apiv1walletsEntries.md @@ -0,0 +1,11 @@ + +# Apiv1walletsEntries + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**publicKey** | **String** | | [optional] +**address** | **String** | | [optional] + + + diff --git a/lib/skyapi/docs/Apiv1walletsMeta.md b/lib/skyapi/docs/Apiv1walletsMeta.md new file mode 100644 index 0000000..b5a7641 --- /dev/null +++ b/lib/skyapi/docs/Apiv1walletsMeta.md @@ -0,0 +1,17 @@ + +# Apiv1walletsMeta + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filename** | **String** | | [optional] +**encrypted** | **Boolean** | | [optional] +**cryptoType** | **String** | | [optional] +**label** | **String** | | [optional] +**type** | **String** | | [optional] +**version** | **String** | | [optional] +**coin** | **String** | | [optional] +**timestamp** | **Integer** | | [optional] + + + diff --git a/lib/skyapi/docs/Apiv1wallettransactionHoursSelection.md b/lib/skyapi/docs/Apiv1wallettransactionHoursSelection.md new file mode 100644 index 0000000..25ff8c3 --- /dev/null +++ b/lib/skyapi/docs/Apiv1wallettransactionHoursSelection.md @@ -0,0 +1,12 @@ + +# Apiv1wallettransactionHoursSelection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **String** | | [optional] +**shareFactor** | **String** | | [optional] +**type** | **String** | | [optional] + + + diff --git a/lib/skyapi/docs/Apiv1wallettransactionTo.md b/lib/skyapi/docs/Apiv1wallettransactionTo.md new file mode 100644 index 0000000..adb3d6a --- /dev/null +++ b/lib/skyapi/docs/Apiv1wallettransactionTo.md @@ -0,0 +1,12 @@ + +# Apiv1wallettransactionTo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hours** | **Long** | | [optional] +**address** | **String** | | [optional] +**coins** | **Long** | | [optional] + + + diff --git a/lib/skyapi/docs/Apiv1wallettransactionWallet.md b/lib/skyapi/docs/Apiv1wallettransactionWallet.md new file mode 100644 index 0000000..632a34b --- /dev/null +++ b/lib/skyapi/docs/Apiv1wallettransactionWallet.md @@ -0,0 +1,13 @@ + +# Apiv1wallettransactionWallet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**unspents** | **List<String>** | | [optional] +**addresses** | **List<String>** | | [optional] +**password** | **String** | | [optional] +**id** | **String** | | [optional] + + + diff --git a/lib/skyapi/docs/DefaultApi.md b/lib/skyapi/docs/DefaultApi.md new file mode 100644 index 0000000..92ba33f --- /dev/null +++ b/lib/skyapi/docs/DefaultApi.md @@ -0,0 +1,2186 @@ +# DefaultApi + +All URIs are relative to *http://127.0.0.1:6420* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addressCount**](DefaultApi.md#addressCount) | **GET** /api/v1/addresscount | Returns the total number of unique address that have coins. +[**addressUxouts**](DefaultApi.md#addressUxouts) | **GET** /api/v1/address_uxouts | +[**balanceGet**](DefaultApi.md#balanceGet) | **GET** /api/v1/balance | Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. +[**balancePost**](DefaultApi.md#balancePost) | **POST** /api/v1/balance | Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. +[**block**](DefaultApi.md#block) | **GET** /api/v1/block | +[**blockchainMetadata**](DefaultApi.md#blockchainMetadata) | **GET** /api/v1/blockchain/metadata | Returns the blockchain metadata. +[**blockchainProgress**](DefaultApi.md#blockchainProgress) | **GET** /api/v1/blockchain/progress | Returns the blockchain sync progress. +[**blocksGet**](DefaultApi.md#blocksGet) | **GET** /api/v1/blocks | blocksHandler returns blocks between a start and end point, +[**blocksPost**](DefaultApi.md#blocksPost) | **POST** /api/v1/blocks | blocksHandler returns blocks between a start and end point, +[**coinSupply**](DefaultApi.md#coinSupply) | **GET** /api/v1/coinSupply | +[**csrf**](DefaultApi.md#csrf) | **GET** /api/v1/csrf | Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. +[**defaultConnections**](DefaultApi.md#defaultConnections) | **GET** /api/v1/network/defaultConnections | defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. +[**explorerAddress**](DefaultApi.md#explorerAddress) | **GET** /api/v1/explorer/address | +[**health**](DefaultApi.md#health) | **GET** /api/v1/health | Returns node health data. +[**lastBlocks**](DefaultApi.md#lastBlocks) | **GET** /api/v1/last_blocks | +[**networkConnection**](DefaultApi.md#networkConnection) | **GET** /api/v1/network/connection | This endpoint returns a specific connection. +[**networkConnections**](DefaultApi.md#networkConnections) | **GET** /api/v1/network/connections | This endpoint returns all outgoings connections. +[**networkConnectionsDisconnect**](DefaultApi.md#networkConnectionsDisconnect) | **POST** /api/v1/network/connection/disconnect | +[**networkConnectionsExchange**](DefaultApi.md#networkConnectionsExchange) | **GET** /api/v1/network/connections/exchange | +[**networkConnectionsTrust**](DefaultApi.md#networkConnectionsTrust) | **GET** /api/v1/network/connections/trust | 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. +[**outputsGet**](DefaultApi.md#outputsGet) | **GET** /api/v1/outputs | 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. +[**outputsPost**](DefaultApi.md#outputsPost) | **POST** /api/v1/outputs | 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. +[**pendingTxs**](DefaultApi.md#pendingTxs) | **GET** /api/v1/pendingTxs | +[**resendUnconfirmedTxns**](DefaultApi.md#resendUnconfirmedTxns) | **POST** /api/v1/resendUnconfirmedTxns | +[**richlist**](DefaultApi.md#richlist) | **GET** /api/v1/richlist | Returns the top skycoin holders. +[**transaction**](DefaultApi.md#transaction) | **GET** /api/v1/transaction | +[**transactionInject**](DefaultApi.md#transactionInject) | **POST** /api/v2/transaction/inject | Broadcast a hex-encoded, serialized transaction to the network. +[**transactionRaw**](DefaultApi.md#transactionRaw) | **GET** /api/v2/transaction/raw | Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. +[**transactionVerify**](DefaultApi.md#transactionVerify) | **POST** /api/v2/transaction/verify | +[**transactionsGet**](DefaultApi.md#transactionsGet) | **GET** /api/v1/transactions | Returns transactions that match the filters. +[**transactionsPost**](DefaultApi.md#transactionsPost) | **POST** /api/v1/transactions | Returns transactions that match the filters. +[**uxout**](DefaultApi.md#uxout) | **GET** /api/v1/uxout | Returns an unspent output by ID. +[**verifyAddress**](DefaultApi.md#verifyAddress) | **POST** /api/v2/address/verify | Verifies a Skycoin address. +[**version**](DefaultApi.md#version) | **GET** /api/v1/version | +[**wallet**](DefaultApi.md#wallet) | **GET** /api/v1/wallet | Returns a wallet by id. +[**walletBalance**](DefaultApi.md#walletBalance) | **GET** /api/v1/wallet/balance | Returns the wallet's balance, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. +[**walletCreate**](DefaultApi.md#walletCreate) | **POST** /api/v1/wallet/create | +[**walletDecrypt**](DefaultApi.md#walletDecrypt) | **POST** /api/v1/wallet/decrypt | Decrypts wallet. +[**walletEncrypt**](DefaultApi.md#walletEncrypt) | **POST** /api/v1/wallet/encrypt | Encrypt wallet. +[**walletFolder**](DefaultApi.md#walletFolder) | **GET** /api/v1/wallets/folderName | +[**walletNewAddress**](DefaultApi.md#walletNewAddress) | **POST** /api/v1/wallet/newAddress | +[**walletNewSeed**](DefaultApi.md#walletNewSeed) | **GET** /api/v1/wallet/newSeed | +[**walletRecover**](DefaultApi.md#walletRecover) | **POST** /api/v2/wallet/recover | 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. +[**walletSeed**](DefaultApi.md#walletSeed) | **POST** /api/v1/wallet/seed | This endpoint only works for encrypted wallets. If the wallet is unencrypted, The seed will be not returned. +[**walletSeedVerify**](DefaultApi.md#walletSeedVerify) | **POST** /api/v2/wallet/seed/verify | Verifies a wallet seed. +[**walletSpent**](DefaultApi.md#walletSpent) | **POST** /api/v1/wallet/spend | +[**walletTransaction**](DefaultApi.md#walletTransaction) | **POST** /api/v1/wallet/transaction | +[**walletTransactions**](DefaultApi.md#walletTransactions) | **GET** /api/v1/wallet/transactions | +[**walletUnload**](DefaultApi.md#walletUnload) | **POST** /api/v1/wallet/unload | Unloads wallet from the wallet service. +[**walletUpdate**](DefaultApi.md#walletUpdate) | **POST** /api/v1/wallet/update | Update the wallet. +[**wallets**](DefaultApi.md#wallets) | **GET** /api/v1/wallets | + + + +# **addressCount** +> Object addressCount() + +Returns the total number of unique address that have coins. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + Object result = apiInstance.addressCount(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#addressCount"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **addressUxouts** +> List<InlineResponse200> addressUxouts(address) + + + +Returns the historical, spent outputs associated with an address + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String address = null; // String | address to filter by +try { + List result = apiInstance.addressUxouts(address); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#addressUxouts"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **address** | **String**| address to filter by | [default to null] + +### Return type + +[**List<InlineResponse200>**](InlineResponse200.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **balanceGet** +> Object balanceGet(addrs) + +Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String addrs = null; // String | command separated list of addresses +try { + Object result = apiInstance.balanceGet(addrs); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#balanceGet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addrs** | **String**| command separated list of addresses | [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **balancePost** +> Object balancePost(addrs) + +Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String addrs = null; // String | command separated list of addresses +try { + Object result = apiInstance.balancePost(addrs); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#balancePost"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addrs** | **String**| command separated list of addresses | [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **block** +> Object block(hash, seq) + + + +Returns a block by hash or seq. Note: only one of hash or seq is allowed + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String hash = null; // String | +Integer seq = null; // Integer | +try { + Object result = apiInstance.block(hash, seq); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#block"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **hash** | **String**| | [optional] [default to null] + **seq** | **Integer**| | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **blockchainMetadata** +> Object blockchainMetadata() + +Returns the blockchain metadata. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + Object result = apiInstance.blockchainMetadata(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#blockchainMetadata"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **blockchainProgress** +> Object blockchainProgress() + +Returns the blockchain sync progress. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + Object result = apiInstance.blockchainProgress(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#blockchainProgress"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **blocksGet** +> Object blocksGet(start, end, seqs) + +blocksHandler returns blocks between a start and end point, + +or an explicit list of sequences. If using start and end, the block sequences include both the start and end point. Explicit sequences cannot be combined with start and end. Without verbose. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +Integer start = null; // Integer | +Integer end = null; // Integer | +List seqs = null; // List | +try { + Object result = apiInstance.blocksGet(start, end, seqs); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#blocksGet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start** | **Integer**| | [optional] [default to null] + **end** | **Integer**| | [optional] [default to null] + **seqs** | [**List<Integer>**](Integer.md)| | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **blocksPost** +> Object blocksPost(start, end, seqs) + +blocksHandler returns blocks between a start and end point, + +or an explicit list of sequences. If using start and end, the block sequences include both the start and end point. Explicit sequences cannot be combined with start and end. Without verbose + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +Integer start = null; // Integer | +Integer end = null; // Integer | +List seqs = null; // List | +try { + Object result = apiInstance.blocksPost(start, end, seqs); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#blocksPost"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start** | **Integer**| | [optional] [default to null] + **end** | **Integer**| | [optional] [default to null] + **seqs** | [**List<Integer>**](Integer.md)| | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **coinSupply** +> coinSupply() + + + +coinSupplyHandler returns coin distribution supply stats + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + apiInstance.coinSupply(); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#coinSupply"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **csrf** +> InlineResponse2001 csrf() + +Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + InlineResponse2001 result = apiInstance.csrf(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#csrf"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponse2001**](InlineResponse2001.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **defaultConnections** +> List<String> defaultConnections() + +defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + List result = apiInstance.defaultConnections(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#defaultConnections"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**List<String>** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **explorerAddress** +> List<InlineResponse2002> explorerAddress(address) + + + +Returns all transactions (confirmed and unconfirmed) for an address + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String address = null; // String | tags to filter by +try { + List result = apiInstance.explorerAddress(address); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#explorerAddress"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **address** | **String**| tags to filter by | [optional] [default to null] + +### Return type + +[**List<InlineResponse2002>**](InlineResponse2002.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **health** +> Object health() + +Returns node health data. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + Object result = apiInstance.health(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#health"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **lastBlocks** +> Object lastBlocks(num) + + + +Returns the most recent N blocks on the blockchain + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +Integer num = null; // Integer | +try { + Object result = apiInstance.lastBlocks(num); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#lastBlocks"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **num** | **Integer**| | [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **networkConnection** +> InlineResponse2003 networkConnection(addr) + +This endpoint returns a specific connection. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String addr = null; // String | Address port +try { + InlineResponse2003 result = apiInstance.networkConnection(addr); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#networkConnection"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addr** | **String**| Address port | [default to null] + +### Return type + +[**InlineResponse2003**](InlineResponse2003.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **networkConnections** +> List<InlineResponse2003> networkConnections(states, direction) + +This endpoint returns all outgoings connections. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String states = null; // String | Connection status. +String direction = null; // String | Direction of the connection. +try { + List result = apiInstance.networkConnections(states, direction); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#networkConnections"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **states** | **String**| Connection status. | [optional] [default to null] [enum: pending, connected, introduced] + **direction** | **String**| Direction of the connection. | [optional] [default to null] [enum: connected, introduced] + +### Return type + +[**List<InlineResponse2003>**](InlineResponse2003.md) + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **networkConnectionsDisconnect** +> networkConnectionsDisconnect(id) + + + +This endpoint disconnects a connection by ID or address + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String id = null; // String | Address id. +try { + apiInstance.networkConnectionsDisconnect(id); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#networkConnectionsDisconnect"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Address id. | [default to null] + +### Return type + +null (empty response body) + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **networkConnectionsExchange** +> List<String> networkConnectionsExchange() + + + +This endpoint returns all connections found through peer exchange + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + List result = apiInstance.networkConnectionsExchange(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#networkConnectionsExchange"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**List<String>** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **networkConnectionsTrust** +> List<String> networkConnectionsTrust() + +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. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + List result = apiInstance.networkConnectionsTrust(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#networkConnectionsTrust"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**List<String>** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **outputsGet** +> Object outputsGet(address, hash) + +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. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +List address = null; // List | +List hash = null; // List | +try { + Object result = apiInstance.outputsGet(address, hash); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#outputsGet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **address** | [**List<String>**](String.md)| | [optional] [default to null] + **hash** | [**List<String>**](String.md)| | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **outputsPost** +> Object outputsPost(address, hash) + +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. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String address = null; // String | +String hash = null; // String | +try { + Object result = apiInstance.outputsPost(address, hash); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#outputsPost"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **address** | **String**| | [optional] [default to null] + **hash** | **String**| | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **pendingTxs** +> List<InlineResponse2004> pendingTxs() + + + +Returns pending (unconfirmed) transactions without verbose + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + List result = apiInstance.pendingTxs(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#pendingTxs"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<InlineResponse2004>**](InlineResponse2004.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **resendUnconfirmedTxns** +> resendUnconfirmedTxns() + + + +Broadcasts all unconfirmed transactions from the unconfirmed transaction pool + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + apiInstance.resendUnconfirmedTxns(); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#resendUnconfirmedTxns"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **richlist** +> Object richlist(includeDistribution, n) + +Returns the top skycoin holders. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +Boolean includeDistribution = null; // Boolean | include distribution addresses or not, default value false +String n = null; // String | include distribution addresses or not, default value false +try { + Object result = apiInstance.richlist(includeDistribution, n); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#richlist"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **includeDistribution** | **Boolean**| include distribution addresses or not, default value false | [optional] [default to null] + **n** | **String**| include distribution addresses or not, default value false | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **transaction** +> Object transaction(txid, encoded) + + + +Returns a transaction identified by its txid hash with just id + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String txid = null; // String | transaction hash +Boolean encoded = null; // Boolean | return as a raw encoded transaction. +try { + Object result = apiInstance.transaction(txid, encoded); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#transaction"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **txid** | **String**| transaction hash | [default to null] + **encoded** | **Boolean**| return as a raw encoded transaction. | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **transactionInject** +> Object transactionInject(rawtx) + +Broadcast a hex-encoded, serialized transaction to the network. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String rawtx = null; // String | hex-encoded serialized transaction string. +try { + Object result = apiInstance.transactionInject(rawtx); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#transactionInject"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **rawtx** | **String**| hex-encoded serialized transaction string. | [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **transactionRaw** +> Object transactionRaw(txid) + +Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String txid = null; // String | Transaction id hash +try { + Object result = apiInstance.transactionRaw(txid); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#transactionRaw"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **txid** | **String**| Transaction id hash | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **transactionVerify** +> Object transactionVerify() + + + +Decode and verify an encoded transaction + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + Object result = apiInstance.transactionVerify(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#transactionVerify"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **transactionsGet** +> Object transactionsGet(addrs, confirmed) + +Returns transactions that match the filters. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String addrs = null; // String | command separated list of addresses +String confirmed = null; // String | Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] +try { + Object result = apiInstance.transactionsGet(addrs, confirmed); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#transactionsGet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addrs** | **String**| command separated list of addresses | [optional] [default to null] + **confirmed** | **String**| Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **transactionsPost** +> Object transactionsPost(addrs, confirmed) + +Returns transactions that match the filters. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String addrs = null; // String | command separated list of addresses +String confirmed = null; // String | Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] +try { + Object result = apiInstance.transactionsPost(addrs, confirmed); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#transactionsPost"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addrs** | **String**| command separated list of addresses | [optional] [default to null] + **confirmed** | **String**| Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **uxout** +> Object uxout(uxid) + +Returns an unspent output by ID. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String uxid = null; // String | uxid to filter by +try { + Object result = apiInstance.uxout(uxid); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#uxout"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uxid** | **String**| uxid to filter by | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **verifyAddress** +> InlineResponse2007 verifyAddress(address) + +Verifies a Skycoin address. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String address = null; // String | Address id. +try { + InlineResponse2007 result = apiInstance.verifyAddress(address); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#verifyAddress"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **address** | **String**| Address id. | [default to null] + +### Return type + +[**InlineResponse2007**](InlineResponse2007.md) + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **version** +> version() + + + +versionHandler returns the application version info + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + apiInstance.version(); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#version"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **wallet** +> Object wallet(id) + +Returns a wallet by id. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String id = null; // String | tags to filter by +try { + Object result = apiInstance.wallet(id); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#wallet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| tags to filter by | [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletBalance** +> Object walletBalance(id) + +Returns the wallet's balance, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String id = null; // String | tags to filter by +try { + Object result = apiInstance.walletBalance(id); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletBalance"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| tags to filter by | [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletCreate** +> Object walletCreate(seed, label, scan, encrypt, password) + + + +Loads wallet from seed, will scan ahead N address and load addresses till the last one that have coins. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String seed = null; // String | Wallet seed. +String label = null; // String | Wallet label. +Integer scan = null; // Integer | The number of addresses to scan ahead for balances. +Boolean encrypt = null; // Boolean | Encrypt wallet. +String password = null; // String | Wallet Password +try { + Object result = apiInstance.walletCreate(seed, label, scan, encrypt, password); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletCreate"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **seed** | **String**| Wallet seed. | [default to null] + **label** | **String**| Wallet label. | [default to null] + **scan** | **Integer**| The number of addresses to scan ahead for balances. | [optional] [default to null] + **encrypt** | **Boolean**| Encrypt wallet. | [optional] [default to null] + **password** | **String**| Wallet Password | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletDecrypt** +> Object walletDecrypt(id, password) + +Decrypts wallet. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String id = null; // String | Wallet id. +String password = null; // String | Wallet password. +try { + Object result = apiInstance.walletDecrypt(id, password); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletDecrypt"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Wallet id. | [default to null] + **password** | **String**| Wallet password. | [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletEncrypt** +> Object walletEncrypt(id, password) + +Encrypt wallet. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String id = null; // String | Wallet id. +String password = null; // String | Wallet password. +try { + Object result = apiInstance.walletEncrypt(id, password); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletEncrypt"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Wallet id. | [default to null] + **password** | **String**| Wallet password. | [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletFolder** +> InlineResponse2006 walletFolder(addr) + + + +Returns the wallet directory path + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String addr = null; // String | Address port +try { + InlineResponse2006 result = apiInstance.walletFolder(addr); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletFolder"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addr** | **String**| Address port | [default to null] + +### Return type + +[**InlineResponse2006**](InlineResponse2006.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletNewAddress** +> Object walletNewAddress(id, num, password) + + + +Generates new addresses + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String id = null; // String | Wallet Id +String num = null; // String | The number you want to generate +String password = null; // String | Wallet Password +try { + Object result = apiInstance.walletNewAddress(id, num, password); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletNewAddress"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Wallet Id | [default to null] + **num** | **String**| The number you want to generate | [optional] [default to null] + **password** | **String**| Wallet Password | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletNewSeed** +> Object walletNewSeed(entropy) + + + +Returns the wallet directory path + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String entropy = null; // String | Entropy bitSize. +try { + Object result = apiInstance.walletNewSeed(entropy); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletNewSeed"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **entropy** | **String**| Entropy bitSize. | [optional] [default to null] [enum: 128, 256] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletRecover** +> Object walletRecover(id, seed, password) + +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. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String id = null; // String | Wallet id. +String seed = null; // String | Wallet seed. +String password = null; // String | Wallet password. +try { + Object result = apiInstance.walletRecover(id, seed, password); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletRecover"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Wallet id. | [default to null] + **seed** | **String**| Wallet seed. | [default to null] + **password** | **String**| Wallet password. | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletSeed** +> Object walletSeed(id, password) + +This endpoint only works for encrypted wallets. If the wallet is unencrypted, The seed will be not returned. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String id = null; // String | Wallet Id. +String password = null; // String | Wallet password. +try { + Object result = apiInstance.walletSeed(id, password); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletSeed"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Wallet Id. | [default to null] + **password** | **String**| Wallet password. | [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletSeedVerify** +> Object walletSeedVerify(seed) + +Verifies a wallet seed. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String seed = null; // String | Seed to be verified. +try { + Object result = apiInstance.walletSeedVerify(seed); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletSeedVerify"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **seed** | **String**| Seed to be verified. | [optional] [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletSpent** +> Object walletSpent(id, dst, coins, password) + + + +Creates and broadcasts a transaction sending money from one of our wallets to destination address. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String id = null; // String | Wallet id +String dst = null; // String | Recipient address +String coins = null; // String | Number of coins to spend, in droplets. 1 coin equals 1e6 droplets. +String password = null; // String | Wallet password. +try { + Object result = apiInstance.walletSpent(id, dst, coins, password); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletSpent"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Wallet id | [default to null] + **dst** | **String**| Recipient address | [default to null] + **coins** | **String**| Number of coins to spend, in droplets. 1 coin equals 1e6 droplets. | [default to null] + **password** | **String**| Wallet password. | [default to null] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletTransaction** +> Object walletTransaction(inlineObject) + + + +Creates a signed transaction + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +InlineObject inlineObject = new InlineObject(); // InlineObject | +try { + Object result = apiInstance.walletTransaction(inlineObject); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletTransaction"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inlineObject** | [**InlineObject**](InlineObject.md)| | [optional] + +### Return type + +**Object** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/json + + +# **walletTransactions** +> Object walletTransactions(id) + + + +Returns returns all unconfirmed transactions for all addresses in a given wallet verbose + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String id = null; // String | Wallet id. +try { + Object result = apiInstance.walletTransactions(id); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletTransactions"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Wallet id. | [default to null] + +### Return type + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletUnload** +> walletUnload(id) + +Unloads wallet from the wallet service. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String id = null; // String | Wallet Id. +try { + apiInstance.walletUnload(id); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletUnload"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Wallet Id. | [default to null] + +### Return type + +null (empty response body) + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **walletUpdate** +> walletUpdate(id, label) + +Update the wallet. + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +String id = null; // String | Wallet Id. +String label = null; // String | The label the wallet will be updated to. +try { + apiInstance.walletUpdate(id, label); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#walletUpdate"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Wallet Id. | [default to null] + **label** | **String**| The label the wallet will be updated to. | [default to null] + +### Return type + +null (empty response body) + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **wallets** +> List<InlineResponse2005> wallets() + + + +Returns all loaded wallets + +### Example +```java +// Import classes: +//import skycoin.DefaultApi; + +DefaultApi apiInstance = new DefaultApi(); +try { + List result = apiInstance.wallets(); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#wallets"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<InlineResponse2005>**](InlineResponse2005.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + diff --git a/lib/skyapi/docs/InlineObject.md b/lib/skyapi/docs/InlineObject.md new file mode 100644 index 0000000..005f518 --- /dev/null +++ b/lib/skyapi/docs/InlineObject.md @@ -0,0 +1,14 @@ + +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**changeAddress** | **String** | | [optional] +**hoursSelection** | [**Apiv1wallettransactionHoursSelection**](Apiv1wallettransactionHoursSelection.md) | | [optional] +**ignoreUnconfirmed** | **Boolean** | | [optional] +**to** | [**List<Apiv1wallettransactionTo>**](Apiv1wallettransactionTo.md) | | [optional] +**wallet** | [**Apiv1wallettransactionWallet**](Apiv1wallettransactionWallet.md) | | [optional] + + + diff --git a/lib/skyapi/docs/InlineResponse200.md b/lib/skyapi/docs/InlineResponse200.md new file mode 100644 index 0000000..7cec3b8 --- /dev/null +++ b/lib/skyapi/docs/InlineResponse200.md @@ -0,0 +1,18 @@ + +# InlineResponse200 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hours** | **Long** | | [optional] +**coins** | **Integer** | | [optional] +**uxid** | **String** | | [optional] +**ownerAddress** | **String** | | [optional] +**spentBlockSeq** | **Integer** | | [optional] +**spentTx** | **String** | | [optional] +**time** | **Long** | | [optional] +**srcBlockSeq** | **Long** | | [optional] +**srcTx** | **String** | | [optional] + + + diff --git a/lib/skyapi/docs/InlineResponse2001.md b/lib/skyapi/docs/InlineResponse2001.md new file mode 100644 index 0000000..6eff12e --- /dev/null +++ b/lib/skyapi/docs/InlineResponse2001.md @@ -0,0 +1,10 @@ + +# InlineResponse2001 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**csrfToken** | **String** | | [optional] + + + diff --git a/lib/skyapi/docs/InlineResponse2002.md b/lib/skyapi/docs/InlineResponse2002.md new file mode 100644 index 0000000..fb3260c --- /dev/null +++ b/lib/skyapi/docs/InlineResponse2002.md @@ -0,0 +1,19 @@ + +# InlineResponse2002 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**outputs** | [**List<Apiv1exploreraddressOutputs>**](Apiv1exploreraddressOutputs.md) | | [optional] +**innerHash** | **String** | | [optional] +**inputs** | [**List<Apiv1exploreraddressInputs>**](Apiv1exploreraddressInputs.md) | | [optional] +**fee** | **Integer** | | [optional] +**sigs** | **List<String>** | | [optional] +**length** | **Long** | | [optional] +**txid** | **String** | | [optional] +**type** | **Integer** | | [optional] +**status** | [**Apiv1exploreraddressStatus**](Apiv1exploreraddressStatus.md) | | [optional] +**timestamp** | **Integer** | | [optional] + + + diff --git a/lib/skyapi/docs/InlineResponse2003.md b/lib/skyapi/docs/InlineResponse2003.md new file mode 100644 index 0000000..9a7435f --- /dev/null +++ b/lib/skyapi/docs/InlineResponse2003.md @@ -0,0 +1,28 @@ + +# InlineResponse2003 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lastReceived** | **Long** | | [optional] +**lastSent** | **Long** | | [optional] +**outgoing** | **Boolean** | | [optional] +**mirror** | **Integer** | | [optional] +**address** | **String** | | [optional] +**listenPort** | **Integer** | | [optional] +**isTrustedPeer** | **Boolean** | | [optional] +**connectedAt** | **Long** | | [optional] +**unconfirmedVerifyTransaction** | [**InlineResponse2003UnconfirmedVerifyTransaction**](InlineResponse2003UnconfirmedVerifyTransaction.md) | | [optional] +**id** | **Long** | | [optional] +**state** | [**StateEnum**](#StateEnum) | | [optional] +**userAgent** | **String** | | [optional] +**height** | **Long** | | [optional] + + + +## Enum: StateEnum +Name | Value +---- | ----- + + + diff --git a/lib/skyapi/docs/InlineResponse2003UnconfirmedVerifyTransaction.md b/lib/skyapi/docs/InlineResponse2003UnconfirmedVerifyTransaction.md new file mode 100644 index 0000000..cca7a9f --- /dev/null +++ b/lib/skyapi/docs/InlineResponse2003UnconfirmedVerifyTransaction.md @@ -0,0 +1,12 @@ + +# InlineResponse2003UnconfirmedVerifyTransaction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**burnFactor** | **Integer** | | [optional] +**maxTransactionSize** | **Integer** | | [optional] +**maxDecimals** | **Integer** | | [optional] + + + diff --git a/lib/skyapi/docs/InlineResponse2004.md b/lib/skyapi/docs/InlineResponse2004.md new file mode 100644 index 0000000..1f476d0 --- /dev/null +++ b/lib/skyapi/docs/InlineResponse2004.md @@ -0,0 +1,14 @@ + +# InlineResponse2004 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**announced** | **String** | | [optional] +**isValid** | **Boolean** | | [optional] +**checked** | **String** | | [optional] +**received** | **String** | | [optional] +**transaction** | [**Apiv1pendingTxsTransaction**](Apiv1pendingTxsTransaction.md) | | [optional] + + + diff --git a/lib/skyapi/docs/InlineResponse2005.md b/lib/skyapi/docs/InlineResponse2005.md new file mode 100644 index 0000000..32666ea --- /dev/null +++ b/lib/skyapi/docs/InlineResponse2005.md @@ -0,0 +1,11 @@ + +# InlineResponse2005 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entries** | [**List<Apiv1walletsEntries>**](Apiv1walletsEntries.md) | | [optional] +**meta** | [**Apiv1walletsMeta**](Apiv1walletsMeta.md) | | [optional] + + + diff --git a/lib/skyapi/docs/InlineResponse2006.md b/lib/skyapi/docs/InlineResponse2006.md new file mode 100644 index 0000000..16e289e --- /dev/null +++ b/lib/skyapi/docs/InlineResponse2006.md @@ -0,0 +1,10 @@ + +# InlineResponse2006 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **String** | | [optional] + + + diff --git a/lib/skyapi/docs/InlineResponse2007.md b/lib/skyapi/docs/InlineResponse2007.md new file mode 100644 index 0000000..5befffb --- /dev/null +++ b/lib/skyapi/docs/InlineResponse2007.md @@ -0,0 +1,11 @@ + +# InlineResponse2007 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**InlineResponse2007Data**](InlineResponse2007Data.md) | | [optional] +**error** | [**Object**](.md) | | [optional] + + + diff --git a/lib/skyapi/docs/InlineResponse2007Data.md b/lib/skyapi/docs/InlineResponse2007Data.md new file mode 100644 index 0000000..e286b3e --- /dev/null +++ b/lib/skyapi/docs/InlineResponse2007Data.md @@ -0,0 +1,10 @@ + +# InlineResponse2007Data + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | **Long** | | [optional] + + + diff --git a/lib/skyapi/docs/InlineResponseDefault.md b/lib/skyapi/docs/InlineResponseDefault.md new file mode 100644 index 0000000..56a9fe6 --- /dev/null +++ b/lib/skyapi/docs/InlineResponseDefault.md @@ -0,0 +1,11 @@ + +# InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Integer** | | [optional] +**message** | **String** | | [optional] + + + diff --git a/lib/skyapi/git_push.sh b/lib/skyapi/git_push.sh new file mode 100644 index 0000000..0f406ef --- /dev/null +++ b/lib/skyapi/git_push.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/lib/skyapi/gradle/wrapper/gradle-wrapper.jar b/lib/skyapi/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..2c6137b Binary files /dev/null and b/lib/skyapi/gradle/wrapper/gradle-wrapper.jar differ diff --git a/lib/skyapi/gradle/wrapper/gradle-wrapper.properties b/lib/skyapi/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..fa45252 --- /dev/null +++ b/lib/skyapi/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon May 16 21:00:11 CST 2016 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip diff --git a/lib/skyapi/gradlew b/lib/skyapi/gradlew new file mode 100644 index 0000000..9d82f78 --- /dev/null +++ b/lib/skyapi/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/lib/skyapi/gradlew.bat b/lib/skyapi/gradlew.bat new file mode 100644 index 0000000..5f19212 --- /dev/null +++ b/lib/skyapi/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/lib/skyapi/pom.xml b/lib/skyapi/pom.xml new file mode 100644 index 0000000..3801206 --- /dev/null +++ b/lib/skyapi/pom.xml @@ -0,0 +1,67 @@ + + + 4.0.0 + Skycoin + skyapi + v0.25.1 + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + org.apache.httpcomponents + httpcore + ${httpcomponents-httpcore-version} + + + org.apache.httpcomponents + httpclient-android + ${httpcomponents-httpclient-version} + + + org.apache.httpcomponents + httpmime + ${httpcomponents-httpmime-version} + + + com.google.code.gson + gson + ${google-code-gson-version} + + + com.mcxiaoke.volley + library + ${volley-library-version} + + + com.google.android + android + ${android-platform-version} + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.5.1 + + 1.7 + 1.7 + + + + + + 1.5.8 + 4.4.4 + 4.5.2 + 4.3.3 + 2.6.2 + 1.0.19 + 4.1.1.4 + + diff --git a/lib/skyapi/src/main/AndroidManifest.xml b/lib/skyapi/src/main/AndroidManifest.xml new file mode 100644 index 0000000..90fc37c --- /dev/null +++ b/lib/skyapi/src/main/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/lib/skyapi/src/main/java/org/openapitools/client/ApiException.java b/lib/skyapi/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 0000000..9d5489c --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,61 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +public class ApiException extends Exception { + int code = 0; + String message = null; + + public ApiException() {} + + public ApiException(int code, String message) { + this.code = code; + this.message = message; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Set the HTTP status code. + * + * @param code HTTP status code. + */ + public void setCode(int code) { + this.code = code; + } + + /** + * Get the error message. + * + * @return Error message. + */ + public String getMessage() { + return message; + } + + /** + * Set the error messages. + * + * @param message Error message. + */ + public void setMessage(String message) { + this.message = message; + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/ApiInvoker.java b/lib/skyapi/src/main/java/org/openapitools/client/ApiInvoker.java new file mode 100644 index 0000000..03969bd --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/ApiInvoker.java @@ -0,0 +1,530 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.android.volley.Cache; +import com.android.volley.DefaultRetryPolicy; +import com.android.volley.Network; +import com.android.volley.Request; +import com.android.volley.RequestQueue; +import com.android.volley.Response; +import com.android.volley.ResponseDelivery; +import com.android.volley.toolbox.BasicNetwork; +import com.android.volley.toolbox.HttpStack; +import com.android.volley.toolbox.HurlStack; +import com.android.volley.toolbox.NoCache; +import com.android.volley.toolbox.RequestFuture; +import com.google.gson.JsonParseException; + +import org.apache.http.Consts; +import org.apache.http.HttpEntity; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.TimeZone; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.ApiKeyAuth; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.request.GetRequest; +import org.openapitools.client.request.PostRequest; +import org.openapitools.client.request.PutRequest; +import org.openapitools.client.request.DeleteRequest; +import org.openapitools.client.request.PatchRequest; + +public class ApiInvoker { + private static ApiInvoker INSTANCE; + private Map defaultHeaderMap = new HashMap(); + + private RequestQueue mRequestQueue; + + private Map authentications; + + private int connectionTimeout; + + /** Content type "text/plain" with UTF-8 encoding. */ + public static final ContentType TEXT_PLAIN_UTF8 = ContentType.create("text/plain", Consts.UTF_8); + + /** + * ISO 8601 date time format. + * @see https://en.wikipedia.org/wiki/ISO_8601 + */ + public static final SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + + /** + * ISO 8601 date format. + * @see https://en.wikipedia.org/wiki/ISO_8601 + */ + public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + + static { + // Use UTC as the default time zone. + DATE_TIME_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); + DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); + } + + public static void setUserAgent(String userAgent) { + INSTANCE.addDefaultHeader("User-Agent", userAgent); + } + + public static Date parseDateTime(String str) { + try { + return DATE_TIME_FORMAT.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } + + public static Date parseDate(String str) { + try { + return DATE_FORMAT.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } + + public static String formatDateTime(Date datetime) { + return DATE_TIME_FORMAT.format(datetime); + } + + public static String formatDate(Date date) { + return DATE_FORMAT.format(date); + } + + public static String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDateTime((Date) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection)param) { + if(b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /* + Format to {@code Pair} objects. + */ + public static List parameterToPairs(String collectionFormat, String name, Object value){ + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null) return params; + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(new Pair(name, parameterToString(value))); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + // get the collection format + collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv + + // create the params based on the collection format + if (collectionFormat.equals("multi")) { + for (Object item : valueCollection) { + params.add(new Pair(name, parameterToString(item))); + } + + return params; + } + + String delimiter = ","; + + if (collectionFormat.equals("csv")) { + delimiter = ","; + } else if (collectionFormat.equals("ssv")) { + delimiter = " "; + } else if (collectionFormat.equals("tsv")) { + delimiter = "\t"; + } else if (collectionFormat.equals("pipes")) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : valueCollection) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + params.add(new Pair(name, sb.substring(1))); + + return params; + } + + public static void initializeInstance() { + initializeInstance(null); + } + + public static void initializeInstance(Cache cache) { + initializeInstance(cache, null, 0, null, 30); + } + + public static void initializeInstance(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) { + INSTANCE = new ApiInvoker(cache, network, threadPoolSize, delivery, connectionTimeout); + setUserAgent("OpenAPI-Generator/v0.25.1/android"); + + // Setup authentications (key: authentication name, value: authentication). + INSTANCE.authentications = new HashMap(); + INSTANCE.authentications.put("csrfAuth", new ApiKeyAuth("header", "X-CSRF-TOKEN")); + // Prevent the authentications from being modified. + INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications); + } + + private ApiInvoker(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) { + if(cache == null) cache = new NoCache(); + if(network == null) { + HttpStack stack = new HurlStack(); + network = new BasicNetwork(stack); + } + + if(delivery == null) { + initConnectionRequest(cache, network); + } else { + initConnectionRequest(cache, network, threadPoolSize, delivery); + } + this.connectionTimeout = connectionTimeout; + } + + public static ApiInvoker getInstance() { + if (INSTANCE == null) initializeInstance(); + return INSTANCE; + } + + public void addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + } + + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "UTF-8"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + public static Object deserialize(String json, String containerType, Class cls) throws ApiException { + try{ + if("list".equalsIgnoreCase(containerType) || "array".equalsIgnoreCase(containerType)) { + return JsonUtil.deserializeToList(json, cls); + } + else if(String.class.equals(cls)) { + if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1) + return json.substring(1, json.length() - 1); + else + return json; + } + else { + return JsonUtil.deserializeToObject(json, cls); + } + } + catch (JsonParseException e) { + throw new ApiException(500, e.getMessage()); + } + } + + public static String serialize(Object obj) throws ApiException { + try { + if (obj != null) + return JsonUtil.serialize(obj); + else + return null; + } + catch (Exception e) { + throw new ApiException(500, e.getMessage()); + } + } + + /** + * Get authentications (key: authentication name, value: authentication). + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + public void setConnectionTimeout(int connectionTimeout){ + this.connectionTimeout = connectionTimeout; + } + + public int getConnectionTimeout() { + return connectionTimeout; + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + */ + private void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); + auth.applyToParams(queryParams, headerParams); + } + } + + public String invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames) throws ApiException, InterruptedException, ExecutionException, TimeoutException { + try { + RequestFuture future = RequestFuture.newFuture(); + Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, future, future); + if(request != null) { + mRequestQueue.add(request); + return future.get(connectionTimeout, TimeUnit.SECONDS); + } else { + return "no data"; + } + } catch (UnsupportedEncodingException ex) { + throw new ApiException(0, "UnsupportedEncodingException"); + } + } + + public void invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException { + try { + Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, stringRequest, errorListener); + if (request != null) { + mRequestQueue.add(request); + } + } catch (UnsupportedEncodingException ex) { + throw new ApiException(0, "UnsupportedEncodingException"); + } + } + + public Request createRequest(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException, UnsupportedEncodingException { + StringBuilder b = new StringBuilder(); + b.append("?"); + + updateParamsForAuth(authNames, queryParams, headerParams); + + if (queryParams != null){ + for (Pair queryParam : queryParams){ + if (!queryParam.getName().isEmpty()) { + b.append(escapeString(queryParam.getName())); + b.append("="); + b.append(escapeString(queryParam.getValue())); + b.append("&"); + } + } + } + + String querystring = b.substring(0, b.length() - 1); + String url = host + path + querystring; + + HashMap headers = new HashMap(); + + for(String key : headerParams.keySet()) { + headers.put(key, headerParams.get(key)); + } + + for(String key : defaultHeaderMap.keySet()) { + if(!headerParams.containsKey(key)) { + headers.put(key, defaultHeaderMap.get(key)); + } + } + headers.put("Accept", "application/json"); + + // URL encoded string from form parameters + String formParamStr = null; + + // for form data + if ("application/x-www-form-urlencoded".equals(contentType)) { + StringBuilder formParamBuilder = new StringBuilder(); + + // encode the form params + for (String key : formParams.keySet()) { + String value = formParams.get(key); + if (value != null && !"".equals(value.trim())) { + if (formParamBuilder.length() > 0) { + formParamBuilder.append("&"); + } + try { + formParamBuilder.append(URLEncoder.encode(key, "utf8")).append("=").append(URLEncoder.encode(value, "utf8")); + } + catch (Exception e) { + // move on to next + } + } + } + formParamStr = formParamBuilder.toString(); + } + Request request = null; + + if ("GET".equals(method)) { + request = new GetRequest(url, headers, null, stringRequest, errorListener); + } + else if ("POST".equals(method)) { + request = null; + if (formParamStr != null) { + request = new PostRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); + } else if (body != null) { + if (body instanceof HttpEntity) { + request = new PostRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); + } else { + request = new PostRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); + } + } else { + request = new PostRequest(url, headers, null, null, stringRequest, errorListener); + } + } + else if ("PUT".equals(method)) { + request = null; + if (formParamStr != null) { + request = new PutRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); + } else if (body != null) { + if (body instanceof HttpEntity) { + request = new PutRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); + } else { + request = new PutRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); + } + } else { + request = new PutRequest(url, headers, null, null, stringRequest, errorListener); + } + } + else if ("DELETE".equals(method)) { + request = null; + if (formParamStr != null) { + request = new DeleteRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); + } else if (body != null) { + if (body instanceof HttpEntity) { + request = new DeleteRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); + } else { + request = new DeleteRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); + } + } else { + request = new DeleteRequest(url, headers, null, null, stringRequest, errorListener); + } + } + else if ("PATCH".equals(method)) { + request = null; + if (formParamStr != null) { + request = new PatchRequest(url, headers, contentType, new StringEntity(formParamStr, "UTF-8"), stringRequest, errorListener); + } else if (body != null) { + if (body instanceof HttpEntity) { + request = new PatchRequest(url, headers, null, (HttpEntity) body, stringRequest, errorListener); + } else { + request = new PatchRequest(url, headers, contentType, new StringEntity(serialize(body), "UTF-8"), stringRequest, errorListener); + } + } else { + request = new PatchRequest(url, headers, null, null, stringRequest, errorListener); + } + } + + if (request != null) { + request.setRetryPolicy(new DefaultRetryPolicy((int)TimeUnit.SECONDS.toMillis(this.connectionTimeout), DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); + } + + return request; + } + + private void initConnectionRequest(Cache cache, Network network) { + mRequestQueue = new RequestQueue(cache, network); + mRequestQueue.start(); + } + + private void initConnectionRequest(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery) { + mRequestQueue = new RequestQueue(cache, network, threadPoolSize, delivery); + mRequestQueue.start(); + } + + public void stopQueue() { + mRequestQueue.stop(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/JsonUtil.java b/lib/skyapi/src/main/java/org/openapitools/client/JsonUtil.java new file mode 100644 index 0000000..0a2b564 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/JsonUtil.java @@ -0,0 +1,237 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.reflect.TypeToken; +import java.lang.reflect.Type; +import java.util.List; +import java.util.Date; +import org.openapitools.client.model.*; + +public class JsonUtil { + public static GsonBuilder gsonBuilder; + + static { + gsonBuilder = new GsonBuilder(); + gsonBuilder.serializeNulls(); + gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + gsonBuilder.registerTypeAdapter(Date.class, new JsonDeserializer() { + public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { + return new Date(json.getAsJsonPrimitive().getAsLong()); + } + }); + } + + public static Gson getGson() { + return gsonBuilder.create(); + } + + public static String serialize(Object obj){ + return getGson().toJson(obj); + } + + public static T deserializeToList(String jsonString, Class cls){ + return getGson().fromJson(jsonString, getListTypeForDeserialization(cls)); + } + + public static T deserializeToObject(String jsonString, Class cls){ + return getGson().fromJson(jsonString, getTypeForDeserialization(cls)); + } + + public static Type getListTypeForDeserialization(Class cls) { + String className = cls.getSimpleName(); + + if ("Apiv1exploreraddressInputs".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("Apiv1exploreraddressOutputs".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("Apiv1exploreraddressStatus".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("Apiv1pendingTxsTransaction".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("Apiv1walletsEntries".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("Apiv1walletsMeta".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("Apiv1wallettransactionHoursSelection".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("Apiv1wallettransactionTo".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("Apiv1wallettransactionWallet".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineObject".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineResponse200".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineResponse2001".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineResponse2002".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineResponse2003".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineResponse2003UnconfirmedVerifyTransaction".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineResponse2004".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineResponse2005".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineResponse2006".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineResponse2007".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineResponse2007Data".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineResponseDefault".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + return new TypeToken>(){}.getType(); + } + + public static Type getTypeForDeserialization(Class cls) { + String className = cls.getSimpleName(); + + if ("Apiv1exploreraddressInputs".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("Apiv1exploreraddressOutputs".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("Apiv1exploreraddressStatus".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("Apiv1pendingTxsTransaction".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("Apiv1walletsEntries".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("Apiv1walletsMeta".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("Apiv1wallettransactionHoursSelection".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("Apiv1wallettransactionTo".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("Apiv1wallettransactionWallet".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineObject".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineResponse200".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineResponse2001".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineResponse2002".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineResponse2003".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineResponse2003UnconfirmedVerifyTransaction".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineResponse2004".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineResponse2005".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineResponse2006".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineResponse2007".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineResponse2007Data".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineResponseDefault".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + return new TypeToken(){}.getType(); + } + +}; diff --git a/lib/skyapi/src/main/java/org/openapitools/client/Pair.java b/lib/skyapi/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000..1e7a02a --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,50 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +public class Pair { + private String name = ""; + private String value = ""; + + public Pair(String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) return; + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) return; + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) return false; + if (arg.trim().isEmpty()) return false; + + return true; + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/lib/skyapi/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000..168d4cf --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,73 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; + +import java.util.Map; +import java.util.List; + +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + String value; + if (apiKey == null) { + return; + } + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/auth/Authentication.java b/lib/skyapi/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000..e0bef21 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,23 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; + +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** Apply authentication settings to header and query params. */ + void applyToParams(List queryParams, Map headerParams); +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/lib/skyapi/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000..3d21e8d --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,47 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; + +import android.util.Base64; + +import java.util.Map; +import java.util.List; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes(), Base64.DEFAULT)); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1exploreraddressInputs.java b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1exploreraddressInputs.java new file mode 100644 index 0000000..fb2787b --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1exploreraddressInputs.java @@ -0,0 +1,123 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class Apiv1exploreraddressInputs { + + @SerializedName("owner") + private String owner = null; + @SerializedName("hours") + private Long hours = null; + @SerializedName("calculated_hours") + private Long calculatedHours = null; + @SerializedName("coins") + private String coins = null; + @SerializedName("uxid") + private String uxid = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getOwner() { + return owner; + } + public void setOwner(String owner) { + this.owner = owner; + } + + /** + **/ + @ApiModelProperty(value = "") + public Long getHours() { + return hours; + } + public void setHours(Long hours) { + this.hours = hours; + } + + /** + **/ + @ApiModelProperty(value = "") + public Long getCalculatedHours() { + return calculatedHours; + } + public void setCalculatedHours(Long calculatedHours) { + this.calculatedHours = calculatedHours; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getCoins() { + return coins; + } + public void setCoins(String coins) { + this.coins = coins; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getUxid() { + return uxid; + } + public void setUxid(String uxid) { + this.uxid = uxid; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apiv1exploreraddressInputs apiv1exploreraddressInputs = (Apiv1exploreraddressInputs) o; + return (this.owner == null ? apiv1exploreraddressInputs.owner == null : this.owner.equals(apiv1exploreraddressInputs.owner)) && + (this.hours == null ? apiv1exploreraddressInputs.hours == null : this.hours.equals(apiv1exploreraddressInputs.hours)) && + (this.calculatedHours == null ? apiv1exploreraddressInputs.calculatedHours == null : this.calculatedHours.equals(apiv1exploreraddressInputs.calculatedHours)) && + (this.coins == null ? apiv1exploreraddressInputs.coins == null : this.coins.equals(apiv1exploreraddressInputs.coins)) && + (this.uxid == null ? apiv1exploreraddressInputs.uxid == null : this.uxid.equals(apiv1exploreraddressInputs.uxid)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.owner == null ? 0: this.owner.hashCode()); + result = 31 * result + (this.hours == null ? 0: this.hours.hashCode()); + result = 31 * result + (this.calculatedHours == null ? 0: this.calculatedHours.hashCode()); + result = 31 * result + (this.coins == null ? 0: this.coins.hashCode()); + result = 31 * result + (this.uxid == null ? 0: this.uxid.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apiv1exploreraddressInputs {\n"); + + sb.append(" owner: ").append(owner).append("\n"); + sb.append(" hours: ").append(hours).append("\n"); + sb.append(" calculatedHours: ").append(calculatedHours).append("\n"); + sb.append(" coins: ").append(coins).append("\n"); + sb.append(" uxid: ").append(uxid).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1exploreraddressOutputs.java b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1exploreraddressOutputs.java new file mode 100644 index 0000000..ac3594e --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1exploreraddressOutputs.java @@ -0,0 +1,108 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class Apiv1exploreraddressOutputs { + + @SerializedName("hours") + private Long hours = null; + @SerializedName("dst") + private String dst = null; + @SerializedName("coins") + private String coins = null; + @SerializedName("uxid") + private String uxid = null; + + /** + **/ + @ApiModelProperty(value = "") + public Long getHours() { + return hours; + } + public void setHours(Long hours) { + this.hours = hours; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getDst() { + return dst; + } + public void setDst(String dst) { + this.dst = dst; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getCoins() { + return coins; + } + public void setCoins(String coins) { + this.coins = coins; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getUxid() { + return uxid; + } + public void setUxid(String uxid) { + this.uxid = uxid; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apiv1exploreraddressOutputs apiv1exploreraddressOutputs = (Apiv1exploreraddressOutputs) o; + return (this.hours == null ? apiv1exploreraddressOutputs.hours == null : this.hours.equals(apiv1exploreraddressOutputs.hours)) && + (this.dst == null ? apiv1exploreraddressOutputs.dst == null : this.dst.equals(apiv1exploreraddressOutputs.dst)) && + (this.coins == null ? apiv1exploreraddressOutputs.coins == null : this.coins.equals(apiv1exploreraddressOutputs.coins)) && + (this.uxid == null ? apiv1exploreraddressOutputs.uxid == null : this.uxid.equals(apiv1exploreraddressOutputs.uxid)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.hours == null ? 0: this.hours.hashCode()); + result = 31 * result + (this.dst == null ? 0: this.dst.hashCode()); + result = 31 * result + (this.coins == null ? 0: this.coins.hashCode()); + result = 31 * result + (this.uxid == null ? 0: this.uxid.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apiv1exploreraddressOutputs {\n"); + + sb.append(" hours: ").append(hours).append("\n"); + sb.append(" dst: ").append(dst).append("\n"); + sb.append(" coins: ").append(coins).append("\n"); + sb.append(" uxid: ").append(uxid).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1exploreraddressStatus.java b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1exploreraddressStatus.java new file mode 100644 index 0000000..d3d471b --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1exploreraddressStatus.java @@ -0,0 +1,108 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class Apiv1exploreraddressStatus { + + @SerializedName("unconfirmed") + private Boolean unconfirmed = null; + @SerializedName("block_seq") + private Long blockSeq = null; + @SerializedName("label") + private Long label = null; + @SerializedName("confirmed") + private Boolean confirmed = null; + + /** + **/ + @ApiModelProperty(value = "") + public Boolean getUnconfirmed() { + return unconfirmed; + } + public void setUnconfirmed(Boolean unconfirmed) { + this.unconfirmed = unconfirmed; + } + + /** + **/ + @ApiModelProperty(value = "") + public Long getBlockSeq() { + return blockSeq; + } + public void setBlockSeq(Long blockSeq) { + this.blockSeq = blockSeq; + } + + /** + **/ + @ApiModelProperty(value = "") + public Long getLabel() { + return label; + } + public void setLabel(Long label) { + this.label = label; + } + + /** + **/ + @ApiModelProperty(value = "") + public Boolean getConfirmed() { + return confirmed; + } + public void setConfirmed(Boolean confirmed) { + this.confirmed = confirmed; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apiv1exploreraddressStatus apiv1exploreraddressStatus = (Apiv1exploreraddressStatus) o; + return (this.unconfirmed == null ? apiv1exploreraddressStatus.unconfirmed == null : this.unconfirmed.equals(apiv1exploreraddressStatus.unconfirmed)) && + (this.blockSeq == null ? apiv1exploreraddressStatus.blockSeq == null : this.blockSeq.equals(apiv1exploreraddressStatus.blockSeq)) && + (this.label == null ? apiv1exploreraddressStatus.label == null : this.label.equals(apiv1exploreraddressStatus.label)) && + (this.confirmed == null ? apiv1exploreraddressStatus.confirmed == null : this.confirmed.equals(apiv1exploreraddressStatus.confirmed)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.unconfirmed == null ? 0: this.unconfirmed.hashCode()); + result = 31 * result + (this.blockSeq == null ? 0: this.blockSeq.hashCode()); + result = 31 * result + (this.label == null ? 0: this.label.hashCode()); + result = 31 * result + (this.confirmed == null ? 0: this.confirmed.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apiv1exploreraddressStatus {\n"); + + sb.append(" unconfirmed: ").append(unconfirmed).append("\n"); + sb.append(" blockSeq: ").append(blockSeq).append("\n"); + sb.append(" label: ").append(label).append("\n"); + sb.append(" confirmed: ").append(confirmed).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1pendingTxsTransaction.java b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1pendingTxsTransaction.java new file mode 100644 index 0000000..8298a3d --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1pendingTxsTransaction.java @@ -0,0 +1,173 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.*; +import org.openapitools.client.model.Apiv1exploreraddressOutputs; +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +/** + * BlockTransactionVerbose has readable transaction data for transactions inside a block. It differs from Transaction in that it includes metadata for transaction inputs and the calculated coinhour fee spent by the block + **/ +@ApiModel(description = "BlockTransactionVerbose has readable transaction data for transactions inside a block. It differs from Transaction in that it includes metadata for transaction inputs and the calculated coinhour fee spent by the block") +public class Apiv1pendingTxsTransaction { + + @SerializedName("outputs") + private List outputs = null; + @SerializedName("inner_hash") + private String innerHash = null; + @SerializedName("inputs") + private List inputs = null; + @SerializedName("sigs") + private List sigs = null; + @SerializedName("length") + private Integer length = null; + @SerializedName("txid") + private String txid = null; + @SerializedName("type") + private Integer type = null; + @SerializedName("timestamp") + private Integer timestamp = null; + + /** + **/ + @ApiModelProperty(value = "") + public List getOutputs() { + return outputs; + } + public void setOutputs(List outputs) { + this.outputs = outputs; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getInnerHash() { + return innerHash; + } + public void setInnerHash(String innerHash) { + this.innerHash = innerHash; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getInputs() { + return inputs; + } + public void setInputs(List inputs) { + this.inputs = inputs; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getSigs() { + return sigs; + } + public void setSigs(List sigs) { + this.sigs = sigs; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getLength() { + return length; + } + public void setLength(Integer length) { + this.length = length; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getTxid() { + return txid; + } + public void setTxid(String txid) { + this.txid = txid; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getType() { + return type; + } + public void setType(Integer type) { + this.type = type; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getTimestamp() { + return timestamp; + } + public void setTimestamp(Integer timestamp) { + this.timestamp = timestamp; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apiv1pendingTxsTransaction apiv1pendingTxsTransaction = (Apiv1pendingTxsTransaction) o; + return (this.outputs == null ? apiv1pendingTxsTransaction.outputs == null : this.outputs.equals(apiv1pendingTxsTransaction.outputs)) && + (this.innerHash == null ? apiv1pendingTxsTransaction.innerHash == null : this.innerHash.equals(apiv1pendingTxsTransaction.innerHash)) && + (this.inputs == null ? apiv1pendingTxsTransaction.inputs == null : this.inputs.equals(apiv1pendingTxsTransaction.inputs)) && + (this.sigs == null ? apiv1pendingTxsTransaction.sigs == null : this.sigs.equals(apiv1pendingTxsTransaction.sigs)) && + (this.length == null ? apiv1pendingTxsTransaction.length == null : this.length.equals(apiv1pendingTxsTransaction.length)) && + (this.txid == null ? apiv1pendingTxsTransaction.txid == null : this.txid.equals(apiv1pendingTxsTransaction.txid)) && + (this.type == null ? apiv1pendingTxsTransaction.type == null : this.type.equals(apiv1pendingTxsTransaction.type)) && + (this.timestamp == null ? apiv1pendingTxsTransaction.timestamp == null : this.timestamp.equals(apiv1pendingTxsTransaction.timestamp)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.outputs == null ? 0: this.outputs.hashCode()); + result = 31 * result + (this.innerHash == null ? 0: this.innerHash.hashCode()); + result = 31 * result + (this.inputs == null ? 0: this.inputs.hashCode()); + result = 31 * result + (this.sigs == null ? 0: this.sigs.hashCode()); + result = 31 * result + (this.length == null ? 0: this.length.hashCode()); + result = 31 * result + (this.txid == null ? 0: this.txid.hashCode()); + result = 31 * result + (this.type == null ? 0: this.type.hashCode()); + result = 31 * result + (this.timestamp == null ? 0: this.timestamp.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apiv1pendingTxsTransaction {\n"); + + sb.append(" outputs: ").append(outputs).append("\n"); + sb.append(" innerHash: ").append(innerHash).append("\n"); + sb.append(" inputs: ").append(inputs).append("\n"); + sb.append(" sigs: ").append(sigs).append("\n"); + sb.append(" length: ").append(length).append("\n"); + sb.append(" txid: ").append(txid).append("\n"); + sb.append(" type: ").append(type).append("\n"); + sb.append(" timestamp: ").append(timestamp).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1walletsEntries.java b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1walletsEntries.java new file mode 100644 index 0000000..72cde72 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1walletsEntries.java @@ -0,0 +1,78 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class Apiv1walletsEntries { + + @SerializedName("public_key") + private String publicKey = null; + @SerializedName("address") + private String address = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getPublicKey() { + return publicKey; + } + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getAddress() { + return address; + } + public void setAddress(String address) { + this.address = address; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apiv1walletsEntries apiv1walletsEntries = (Apiv1walletsEntries) o; + return (this.publicKey == null ? apiv1walletsEntries.publicKey == null : this.publicKey.equals(apiv1walletsEntries.publicKey)) && + (this.address == null ? apiv1walletsEntries.address == null : this.address.equals(apiv1walletsEntries.address)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.publicKey == null ? 0: this.publicKey.hashCode()); + result = 31 * result + (this.address == null ? 0: this.address.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apiv1walletsEntries {\n"); + + sb.append(" publicKey: ").append(publicKey).append("\n"); + sb.append(" address: ").append(address).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1walletsMeta.java b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1walletsMeta.java new file mode 100644 index 0000000..85ca12f --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1walletsMeta.java @@ -0,0 +1,168 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class Apiv1walletsMeta { + + @SerializedName("filename") + private String filename = null; + @SerializedName("encrypted") + private Boolean encrypted = null; + @SerializedName("crypto_type") + private String cryptoType = null; + @SerializedName("label") + private String label = null; + @SerializedName("type") + private String type = null; + @SerializedName("version") + private String version = null; + @SerializedName("coin") + private String coin = null; + @SerializedName("timestamp") + private Integer timestamp = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getFilename() { + return filename; + } + public void setFilename(String filename) { + this.filename = filename; + } + + /** + **/ + @ApiModelProperty(value = "") + public Boolean getEncrypted() { + return encrypted; + } + public void setEncrypted(Boolean encrypted) { + this.encrypted = encrypted; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getCryptoType() { + return cryptoType; + } + public void setCryptoType(String cryptoType) { + this.cryptoType = cryptoType; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getLabel() { + return label; + } + public void setLabel(String label) { + this.label = label; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getVersion() { + return version; + } + public void setVersion(String version) { + this.version = version; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getCoin() { + return coin; + } + public void setCoin(String coin) { + this.coin = coin; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getTimestamp() { + return timestamp; + } + public void setTimestamp(Integer timestamp) { + this.timestamp = timestamp; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apiv1walletsMeta apiv1walletsMeta = (Apiv1walletsMeta) o; + return (this.filename == null ? apiv1walletsMeta.filename == null : this.filename.equals(apiv1walletsMeta.filename)) && + (this.encrypted == null ? apiv1walletsMeta.encrypted == null : this.encrypted.equals(apiv1walletsMeta.encrypted)) && + (this.cryptoType == null ? apiv1walletsMeta.cryptoType == null : this.cryptoType.equals(apiv1walletsMeta.cryptoType)) && + (this.label == null ? apiv1walletsMeta.label == null : this.label.equals(apiv1walletsMeta.label)) && + (this.type == null ? apiv1walletsMeta.type == null : this.type.equals(apiv1walletsMeta.type)) && + (this.version == null ? apiv1walletsMeta.version == null : this.version.equals(apiv1walletsMeta.version)) && + (this.coin == null ? apiv1walletsMeta.coin == null : this.coin.equals(apiv1walletsMeta.coin)) && + (this.timestamp == null ? apiv1walletsMeta.timestamp == null : this.timestamp.equals(apiv1walletsMeta.timestamp)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.filename == null ? 0: this.filename.hashCode()); + result = 31 * result + (this.encrypted == null ? 0: this.encrypted.hashCode()); + result = 31 * result + (this.cryptoType == null ? 0: this.cryptoType.hashCode()); + result = 31 * result + (this.label == null ? 0: this.label.hashCode()); + result = 31 * result + (this.type == null ? 0: this.type.hashCode()); + result = 31 * result + (this.version == null ? 0: this.version.hashCode()); + result = 31 * result + (this.coin == null ? 0: this.coin.hashCode()); + result = 31 * result + (this.timestamp == null ? 0: this.timestamp.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apiv1walletsMeta {\n"); + + sb.append(" filename: ").append(filename).append("\n"); + sb.append(" encrypted: ").append(encrypted).append("\n"); + sb.append(" cryptoType: ").append(cryptoType).append("\n"); + sb.append(" label: ").append(label).append("\n"); + sb.append(" type: ").append(type).append("\n"); + sb.append(" version: ").append(version).append("\n"); + sb.append(" coin: ").append(coin).append("\n"); + sb.append(" timestamp: ").append(timestamp).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1wallettransactionHoursSelection.java b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1wallettransactionHoursSelection.java new file mode 100644 index 0000000..9a5fbd5 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1wallettransactionHoursSelection.java @@ -0,0 +1,93 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class Apiv1wallettransactionHoursSelection { + + @SerializedName("mode") + private String mode = null; + @SerializedName("share_factor") + private String shareFactor = null; + @SerializedName("type") + private String type = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getMode() { + return mode; + } + public void setMode(String mode) { + this.mode = mode; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getShareFactor() { + return shareFactor; + } + public void setShareFactor(String shareFactor) { + this.shareFactor = shareFactor; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apiv1wallettransactionHoursSelection apiv1wallettransactionHoursSelection = (Apiv1wallettransactionHoursSelection) o; + return (this.mode == null ? apiv1wallettransactionHoursSelection.mode == null : this.mode.equals(apiv1wallettransactionHoursSelection.mode)) && + (this.shareFactor == null ? apiv1wallettransactionHoursSelection.shareFactor == null : this.shareFactor.equals(apiv1wallettransactionHoursSelection.shareFactor)) && + (this.type == null ? apiv1wallettransactionHoursSelection.type == null : this.type.equals(apiv1wallettransactionHoursSelection.type)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.mode == null ? 0: this.mode.hashCode()); + result = 31 * result + (this.shareFactor == null ? 0: this.shareFactor.hashCode()); + result = 31 * result + (this.type == null ? 0: this.type.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apiv1wallettransactionHoursSelection {\n"); + + sb.append(" mode: ").append(mode).append("\n"); + sb.append(" shareFactor: ").append(shareFactor).append("\n"); + sb.append(" type: ").append(type).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1wallettransactionTo.java b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1wallettransactionTo.java new file mode 100644 index 0000000..2728c8f --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1wallettransactionTo.java @@ -0,0 +1,93 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class Apiv1wallettransactionTo { + + @SerializedName("hours") + private Long hours = null; + @SerializedName("address") + private String address = null; + @SerializedName("coins") + private Long coins = null; + + /** + **/ + @ApiModelProperty(value = "") + public Long getHours() { + return hours; + } + public void setHours(Long hours) { + this.hours = hours; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getAddress() { + return address; + } + public void setAddress(String address) { + this.address = address; + } + + /** + **/ + @ApiModelProperty(value = "") + public Long getCoins() { + return coins; + } + public void setCoins(Long coins) { + this.coins = coins; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apiv1wallettransactionTo apiv1wallettransactionTo = (Apiv1wallettransactionTo) o; + return (this.hours == null ? apiv1wallettransactionTo.hours == null : this.hours.equals(apiv1wallettransactionTo.hours)) && + (this.address == null ? apiv1wallettransactionTo.address == null : this.address.equals(apiv1wallettransactionTo.address)) && + (this.coins == null ? apiv1wallettransactionTo.coins == null : this.coins.equals(apiv1wallettransactionTo.coins)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.hours == null ? 0: this.hours.hashCode()); + result = 31 * result + (this.address == null ? 0: this.address.hashCode()); + result = 31 * result + (this.coins == null ? 0: this.coins.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apiv1wallettransactionTo {\n"); + + sb.append(" hours: ").append(hours).append("\n"); + sb.append(" address: ").append(address).append("\n"); + sb.append(" coins: ").append(coins).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1wallettransactionWallet.java b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1wallettransactionWallet.java new file mode 100644 index 0000000..cf5a30d --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/Apiv1wallettransactionWallet.java @@ -0,0 +1,109 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.*; +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class Apiv1wallettransactionWallet { + + @SerializedName("unspents") + private List unspents = null; + @SerializedName("addresses") + private List addresses = null; + @SerializedName("password") + private String password = null; + @SerializedName("id") + private String id = null; + + /** + **/ + @ApiModelProperty(value = "") + public List getUnspents() { + return unspents; + } + public void setUnspents(List unspents) { + this.unspents = unspents; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getAddresses() { + return addresses; + } + public void setAddresses(List addresses) { + this.addresses = addresses; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apiv1wallettransactionWallet apiv1wallettransactionWallet = (Apiv1wallettransactionWallet) o; + return (this.unspents == null ? apiv1wallettransactionWallet.unspents == null : this.unspents.equals(apiv1wallettransactionWallet.unspents)) && + (this.addresses == null ? apiv1wallettransactionWallet.addresses == null : this.addresses.equals(apiv1wallettransactionWallet.addresses)) && + (this.password == null ? apiv1wallettransactionWallet.password == null : this.password.equals(apiv1wallettransactionWallet.password)) && + (this.id == null ? apiv1wallettransactionWallet.id == null : this.id.equals(apiv1wallettransactionWallet.id)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.unspents == null ? 0: this.unspents.hashCode()); + result = 31 * result + (this.addresses == null ? 0: this.addresses.hashCode()); + result = 31 * result + (this.password == null ? 0: this.password.hashCode()); + result = 31 * result + (this.id == null ? 0: this.id.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apiv1wallettransactionWallet {\n"); + + sb.append(" unspents: ").append(unspents).append("\n"); + sb.append(" addresses: ").append(addresses).append("\n"); + sb.append(" password: ").append(password).append("\n"); + sb.append(" id: ").append(id).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/InlineObject.java b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineObject.java new file mode 100644 index 0000000..4894372 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineObject.java @@ -0,0 +1,127 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.*; +import org.openapitools.client.model.Apiv1wallettransactionHoursSelection; +import org.openapitools.client.model.Apiv1wallettransactionTo; +import org.openapitools.client.model.Apiv1wallettransactionWallet; +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class InlineObject { + + @SerializedName("change_address") + private String changeAddress = null; + @SerializedName("hours_selection") + private Apiv1wallettransactionHoursSelection hoursSelection = null; + @SerializedName("ignore_unconfirmed") + private Boolean ignoreUnconfirmed = null; + @SerializedName("to") + private List to = null; + @SerializedName("wallet") + private Apiv1wallettransactionWallet wallet = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getChangeAddress() { + return changeAddress; + } + public void setChangeAddress(String changeAddress) { + this.changeAddress = changeAddress; + } + + /** + **/ + @ApiModelProperty(value = "") + public Apiv1wallettransactionHoursSelection getHoursSelection() { + return hoursSelection; + } + public void setHoursSelection(Apiv1wallettransactionHoursSelection hoursSelection) { + this.hoursSelection = hoursSelection; + } + + /** + **/ + @ApiModelProperty(value = "") + public Boolean getIgnoreUnconfirmed() { + return ignoreUnconfirmed; + } + public void setIgnoreUnconfirmed(Boolean ignoreUnconfirmed) { + this.ignoreUnconfirmed = ignoreUnconfirmed; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getTo() { + return to; + } + public void setTo(List to) { + this.to = to; + } + + /** + **/ + @ApiModelProperty(value = "") + public Apiv1wallettransactionWallet getWallet() { + return wallet; + } + public void setWallet(Apiv1wallettransactionWallet wallet) { + this.wallet = wallet; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject inlineObject = (InlineObject) o; + return (this.changeAddress == null ? inlineObject.changeAddress == null : this.changeAddress.equals(inlineObject.changeAddress)) && + (this.hoursSelection == null ? inlineObject.hoursSelection == null : this.hoursSelection.equals(inlineObject.hoursSelection)) && + (this.ignoreUnconfirmed == null ? inlineObject.ignoreUnconfirmed == null : this.ignoreUnconfirmed.equals(inlineObject.ignoreUnconfirmed)) && + (this.to == null ? inlineObject.to == null : this.to.equals(inlineObject.to)) && + (this.wallet == null ? inlineObject.wallet == null : this.wallet.equals(inlineObject.wallet)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.changeAddress == null ? 0: this.changeAddress.hashCode()); + result = 31 * result + (this.hoursSelection == null ? 0: this.hoursSelection.hashCode()); + result = 31 * result + (this.ignoreUnconfirmed == null ? 0: this.ignoreUnconfirmed.hashCode()); + result = 31 * result + (this.to == null ? 0: this.to.hashCode()); + result = 31 * result + (this.wallet == null ? 0: this.wallet.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject {\n"); + + sb.append(" changeAddress: ").append(changeAddress).append("\n"); + sb.append(" hoursSelection: ").append(hoursSelection).append("\n"); + sb.append(" ignoreUnconfirmed: ").append(ignoreUnconfirmed).append("\n"); + sb.append(" to: ").append(to).append("\n"); + sb.append(" wallet: ").append(wallet).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse200.java b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse200.java new file mode 100644 index 0000000..1c13aeb --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse200.java @@ -0,0 +1,183 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class InlineResponse200 { + + @SerializedName("hours") + private Long hours = null; + @SerializedName("coins") + private Integer coins = null; + @SerializedName("uxid") + private String uxid = null; + @SerializedName("owner_address") + private String ownerAddress = null; + @SerializedName("spent_block_seq") + private Integer spentBlockSeq = null; + @SerializedName("spent_tx") + private String spentTx = null; + @SerializedName("time") + private Long time = null; + @SerializedName("src_block_seq") + private Long srcBlockSeq = null; + @SerializedName("src_tx") + private String srcTx = null; + + /** + **/ + @ApiModelProperty(value = "") + public Long getHours() { + return hours; + } + public void setHours(Long hours) { + this.hours = hours; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getCoins() { + return coins; + } + public void setCoins(Integer coins) { + this.coins = coins; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getUxid() { + return uxid; + } + public void setUxid(String uxid) { + this.uxid = uxid; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getOwnerAddress() { + return ownerAddress; + } + public void setOwnerAddress(String ownerAddress) { + this.ownerAddress = ownerAddress; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getSpentBlockSeq() { + return spentBlockSeq; + } + public void setSpentBlockSeq(Integer spentBlockSeq) { + this.spentBlockSeq = spentBlockSeq; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getSpentTx() { + return spentTx; + } + public void setSpentTx(String spentTx) { + this.spentTx = spentTx; + } + + /** + **/ + @ApiModelProperty(value = "") + public Long getTime() { + return time; + } + public void setTime(Long time) { + this.time = time; + } + + /** + **/ + @ApiModelProperty(value = "") + public Long getSrcBlockSeq() { + return srcBlockSeq; + } + public void setSrcBlockSeq(Long srcBlockSeq) { + this.srcBlockSeq = srcBlockSeq; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getSrcTx() { + return srcTx; + } + public void setSrcTx(String srcTx) { + this.srcTx = srcTx; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse200 inlineResponse200 = (InlineResponse200) o; + return (this.hours == null ? inlineResponse200.hours == null : this.hours.equals(inlineResponse200.hours)) && + (this.coins == null ? inlineResponse200.coins == null : this.coins.equals(inlineResponse200.coins)) && + (this.uxid == null ? inlineResponse200.uxid == null : this.uxid.equals(inlineResponse200.uxid)) && + (this.ownerAddress == null ? inlineResponse200.ownerAddress == null : this.ownerAddress.equals(inlineResponse200.ownerAddress)) && + (this.spentBlockSeq == null ? inlineResponse200.spentBlockSeq == null : this.spentBlockSeq.equals(inlineResponse200.spentBlockSeq)) && + (this.spentTx == null ? inlineResponse200.spentTx == null : this.spentTx.equals(inlineResponse200.spentTx)) && + (this.time == null ? inlineResponse200.time == null : this.time.equals(inlineResponse200.time)) && + (this.srcBlockSeq == null ? inlineResponse200.srcBlockSeq == null : this.srcBlockSeq.equals(inlineResponse200.srcBlockSeq)) && + (this.srcTx == null ? inlineResponse200.srcTx == null : this.srcTx.equals(inlineResponse200.srcTx)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.hours == null ? 0: this.hours.hashCode()); + result = 31 * result + (this.coins == null ? 0: this.coins.hashCode()); + result = 31 * result + (this.uxid == null ? 0: this.uxid.hashCode()); + result = 31 * result + (this.ownerAddress == null ? 0: this.ownerAddress.hashCode()); + result = 31 * result + (this.spentBlockSeq == null ? 0: this.spentBlockSeq.hashCode()); + result = 31 * result + (this.spentTx == null ? 0: this.spentTx.hashCode()); + result = 31 * result + (this.time == null ? 0: this.time.hashCode()); + result = 31 * result + (this.srcBlockSeq == null ? 0: this.srcBlockSeq.hashCode()); + result = 31 * result + (this.srcTx == null ? 0: this.srcTx.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse200 {\n"); + + sb.append(" hours: ").append(hours).append("\n"); + sb.append(" coins: ").append(coins).append("\n"); + sb.append(" uxid: ").append(uxid).append("\n"); + sb.append(" ownerAddress: ").append(ownerAddress).append("\n"); + sb.append(" spentBlockSeq: ").append(spentBlockSeq).append("\n"); + sb.append(" spentTx: ").append(spentTx).append("\n"); + sb.append(" time: ").append(time).append("\n"); + sb.append(" srcBlockSeq: ").append(srcBlockSeq).append("\n"); + sb.append(" srcTx: ").append(srcTx).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2001.java b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2001.java new file mode 100644 index 0000000..7eddba3 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2001.java @@ -0,0 +1,63 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class InlineResponse2001 { + + @SerializedName("csrf_token") + private String csrfToken = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getCsrfToken() { + return csrfToken; + } + public void setCsrfToken(String csrfToken) { + this.csrfToken = csrfToken; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse2001 inlineResponse2001 = (InlineResponse2001) o; + return (this.csrfToken == null ? inlineResponse2001.csrfToken == null : this.csrfToken.equals(inlineResponse2001.csrfToken)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.csrfToken == null ? 0: this.csrfToken.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse2001 {\n"); + + sb.append(" csrfToken: ").append(csrfToken).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2002.java b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2002.java new file mode 100644 index 0000000..840fc2f --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2002.java @@ -0,0 +1,202 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.*; +import org.openapitools.client.model.Apiv1exploreraddressInputs; +import org.openapitools.client.model.Apiv1exploreraddressOutputs; +import org.openapitools.client.model.Apiv1exploreraddressStatus; +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class InlineResponse2002 { + + @SerializedName("outputs") + private List outputs = null; + @SerializedName("inner_hash") + private String innerHash = null; + @SerializedName("inputs") + private List inputs = null; + @SerializedName("fee") + private Integer fee = null; + @SerializedName("sigs") + private List sigs = null; + @SerializedName("length") + private Long length = null; + @SerializedName("txid") + private String txid = null; + @SerializedName("type") + private Integer type = null; + @SerializedName("status") + private Apiv1exploreraddressStatus status = null; + @SerializedName("timestamp") + private Integer timestamp = null; + + /** + **/ + @ApiModelProperty(value = "") + public List getOutputs() { + return outputs; + } + public void setOutputs(List outputs) { + this.outputs = outputs; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getInnerHash() { + return innerHash; + } + public void setInnerHash(String innerHash) { + this.innerHash = innerHash; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getInputs() { + return inputs; + } + public void setInputs(List inputs) { + this.inputs = inputs; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getFee() { + return fee; + } + public void setFee(Integer fee) { + this.fee = fee; + } + + /** + **/ + @ApiModelProperty(value = "") + public List getSigs() { + return sigs; + } + public void setSigs(List sigs) { + this.sigs = sigs; + } + + /** + **/ + @ApiModelProperty(value = "") + public Long getLength() { + return length; + } + public void setLength(Long length) { + this.length = length; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getTxid() { + return txid; + } + public void setTxid(String txid) { + this.txid = txid; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getType() { + return type; + } + public void setType(Integer type) { + this.type = type; + } + + /** + **/ + @ApiModelProperty(value = "") + public Apiv1exploreraddressStatus getStatus() { + return status; + } + public void setStatus(Apiv1exploreraddressStatus status) { + this.status = status; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getTimestamp() { + return timestamp; + } + public void setTimestamp(Integer timestamp) { + this.timestamp = timestamp; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse2002 inlineResponse2002 = (InlineResponse2002) o; + return (this.outputs == null ? inlineResponse2002.outputs == null : this.outputs.equals(inlineResponse2002.outputs)) && + (this.innerHash == null ? inlineResponse2002.innerHash == null : this.innerHash.equals(inlineResponse2002.innerHash)) && + (this.inputs == null ? inlineResponse2002.inputs == null : this.inputs.equals(inlineResponse2002.inputs)) && + (this.fee == null ? inlineResponse2002.fee == null : this.fee.equals(inlineResponse2002.fee)) && + (this.sigs == null ? inlineResponse2002.sigs == null : this.sigs.equals(inlineResponse2002.sigs)) && + (this.length == null ? inlineResponse2002.length == null : this.length.equals(inlineResponse2002.length)) && + (this.txid == null ? inlineResponse2002.txid == null : this.txid.equals(inlineResponse2002.txid)) && + (this.type == null ? inlineResponse2002.type == null : this.type.equals(inlineResponse2002.type)) && + (this.status == null ? inlineResponse2002.status == null : this.status.equals(inlineResponse2002.status)) && + (this.timestamp == null ? inlineResponse2002.timestamp == null : this.timestamp.equals(inlineResponse2002.timestamp)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.outputs == null ? 0: this.outputs.hashCode()); + result = 31 * result + (this.innerHash == null ? 0: this.innerHash.hashCode()); + result = 31 * result + (this.inputs == null ? 0: this.inputs.hashCode()); + result = 31 * result + (this.fee == null ? 0: this.fee.hashCode()); + result = 31 * result + (this.sigs == null ? 0: this.sigs.hashCode()); + result = 31 * result + (this.length == null ? 0: this.length.hashCode()); + result = 31 * result + (this.txid == null ? 0: this.txid.hashCode()); + result = 31 * result + (this.type == null ? 0: this.type.hashCode()); + result = 31 * result + (this.status == null ? 0: this.status.hashCode()); + result = 31 * result + (this.timestamp == null ? 0: this.timestamp.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse2002 {\n"); + + sb.append(" outputs: ").append(outputs).append("\n"); + sb.append(" innerHash: ").append(innerHash).append("\n"); + sb.append(" inputs: ").append(inputs).append("\n"); + sb.append(" fee: ").append(fee).append("\n"); + sb.append(" sigs: ").append(sigs).append("\n"); + sb.append(" length: ").append(length).append("\n"); + sb.append(" txid: ").append(txid).append("\n"); + sb.append(" type: ").append(type).append("\n"); + sb.append(" status: ").append(status).append("\n"); + sb.append(" timestamp: ").append(timestamp).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2003.java b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2003.java new file mode 100644 index 0000000..92f003e --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2003.java @@ -0,0 +1,247 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.openapitools.client.model.InlineResponse2003UnconfirmedVerifyTransaction; +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class InlineResponse2003 { + + @SerializedName("last_received") + private Long lastReceived = null; + @SerializedName("last_sent") + private Long lastSent = null; + @SerializedName("outgoing") + private Boolean outgoing = null; + @SerializedName("mirror") + private Integer mirror = null; + @SerializedName("address") + private String address = null; + @SerializedName("listen_port") + private Integer listenPort = null; + @SerializedName("is_trusted_peer") + private Boolean isTrustedPeer = null; + @SerializedName("connected_at") + private Long connectedAt = null; + @SerializedName("unconfirmed_verify_transaction") + private InlineResponse2003UnconfirmedVerifyTransaction unconfirmedVerifyTransaction = null; + @SerializedName("id") + private Long id = null; + public enum StateEnum { + pending, connected, introduced, + }; + @SerializedName("state") + private StateEnum state = null; + @SerializedName("user_agent") + private String userAgent = null; + @SerializedName("height") + private Long height = null; + + /** + **/ + @ApiModelProperty(value = "") + public Long getLastReceived() { + return lastReceived; + } + public void setLastReceived(Long lastReceived) { + this.lastReceived = lastReceived; + } + + /** + **/ + @ApiModelProperty(value = "") + public Long getLastSent() { + return lastSent; + } + public void setLastSent(Long lastSent) { + this.lastSent = lastSent; + } + + /** + **/ + @ApiModelProperty(value = "") + public Boolean getOutgoing() { + return outgoing; + } + public void setOutgoing(Boolean outgoing) { + this.outgoing = outgoing; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getMirror() { + return mirror; + } + public void setMirror(Integer mirror) { + this.mirror = mirror; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getAddress() { + return address; + } + public void setAddress(String address) { + this.address = address; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getListenPort() { + return listenPort; + } + public void setListenPort(Integer listenPort) { + this.listenPort = listenPort; + } + + /** + **/ + @ApiModelProperty(value = "") + public Boolean getIsTrustedPeer() { + return isTrustedPeer; + } + public void setIsTrustedPeer(Boolean isTrustedPeer) { + this.isTrustedPeer = isTrustedPeer; + } + + /** + **/ + @ApiModelProperty(value = "") + public Long getConnectedAt() { + return connectedAt; + } + public void setConnectedAt(Long connectedAt) { + this.connectedAt = connectedAt; + } + + /** + **/ + @ApiModelProperty(value = "") + public InlineResponse2003UnconfirmedVerifyTransaction getUnconfirmedVerifyTransaction() { + return unconfirmedVerifyTransaction; + } + public void setUnconfirmedVerifyTransaction(InlineResponse2003UnconfirmedVerifyTransaction unconfirmedVerifyTransaction) { + this.unconfirmedVerifyTransaction = unconfirmedVerifyTransaction; + } + + /** + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + @ApiModelProperty(value = "") + public StateEnum getState() { + return state; + } + public void setState(StateEnum state) { + this.state = state; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getUserAgent() { + return userAgent; + } + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + /** + **/ + @ApiModelProperty(value = "") + public Long getHeight() { + return height; + } + public void setHeight(Long height) { + this.height = height; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse2003 inlineResponse2003 = (InlineResponse2003) o; + return (this.lastReceived == null ? inlineResponse2003.lastReceived == null : this.lastReceived.equals(inlineResponse2003.lastReceived)) && + (this.lastSent == null ? inlineResponse2003.lastSent == null : this.lastSent.equals(inlineResponse2003.lastSent)) && + (this.outgoing == null ? inlineResponse2003.outgoing == null : this.outgoing.equals(inlineResponse2003.outgoing)) && + (this.mirror == null ? inlineResponse2003.mirror == null : this.mirror.equals(inlineResponse2003.mirror)) && + (this.address == null ? inlineResponse2003.address == null : this.address.equals(inlineResponse2003.address)) && + (this.listenPort == null ? inlineResponse2003.listenPort == null : this.listenPort.equals(inlineResponse2003.listenPort)) && + (this.isTrustedPeer == null ? inlineResponse2003.isTrustedPeer == null : this.isTrustedPeer.equals(inlineResponse2003.isTrustedPeer)) && + (this.connectedAt == null ? inlineResponse2003.connectedAt == null : this.connectedAt.equals(inlineResponse2003.connectedAt)) && + (this.unconfirmedVerifyTransaction == null ? inlineResponse2003.unconfirmedVerifyTransaction == null : this.unconfirmedVerifyTransaction.equals(inlineResponse2003.unconfirmedVerifyTransaction)) && + (this.id == null ? inlineResponse2003.id == null : this.id.equals(inlineResponse2003.id)) && + (this.state == null ? inlineResponse2003.state == null : this.state.equals(inlineResponse2003.state)) && + (this.userAgent == null ? inlineResponse2003.userAgent == null : this.userAgent.equals(inlineResponse2003.userAgent)) && + (this.height == null ? inlineResponse2003.height == null : this.height.equals(inlineResponse2003.height)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.lastReceived == null ? 0: this.lastReceived.hashCode()); + result = 31 * result + (this.lastSent == null ? 0: this.lastSent.hashCode()); + result = 31 * result + (this.outgoing == null ? 0: this.outgoing.hashCode()); + result = 31 * result + (this.mirror == null ? 0: this.mirror.hashCode()); + result = 31 * result + (this.address == null ? 0: this.address.hashCode()); + result = 31 * result + (this.listenPort == null ? 0: this.listenPort.hashCode()); + result = 31 * result + (this.isTrustedPeer == null ? 0: this.isTrustedPeer.hashCode()); + result = 31 * result + (this.connectedAt == null ? 0: this.connectedAt.hashCode()); + result = 31 * result + (this.unconfirmedVerifyTransaction == null ? 0: this.unconfirmedVerifyTransaction.hashCode()); + result = 31 * result + (this.id == null ? 0: this.id.hashCode()); + result = 31 * result + (this.state == null ? 0: this.state.hashCode()); + result = 31 * result + (this.userAgent == null ? 0: this.userAgent.hashCode()); + result = 31 * result + (this.height == null ? 0: this.height.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse2003 {\n"); + + sb.append(" lastReceived: ").append(lastReceived).append("\n"); + sb.append(" lastSent: ").append(lastSent).append("\n"); + sb.append(" outgoing: ").append(outgoing).append("\n"); + sb.append(" mirror: ").append(mirror).append("\n"); + sb.append(" address: ").append(address).append("\n"); + sb.append(" listenPort: ").append(listenPort).append("\n"); + sb.append(" isTrustedPeer: ").append(isTrustedPeer).append("\n"); + sb.append(" connectedAt: ").append(connectedAt).append("\n"); + sb.append(" unconfirmedVerifyTransaction: ").append(unconfirmedVerifyTransaction).append("\n"); + sb.append(" id: ").append(id).append("\n"); + sb.append(" state: ").append(state).append("\n"); + sb.append(" userAgent: ").append(userAgent).append("\n"); + sb.append(" height: ").append(height).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2003UnconfirmedVerifyTransaction.java b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2003UnconfirmedVerifyTransaction.java new file mode 100644 index 0000000..c591df4 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2003UnconfirmedVerifyTransaction.java @@ -0,0 +1,96 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +/** + * Represent unconfirmed transactions + **/ +@ApiModel(description = "Represent unconfirmed transactions") +public class InlineResponse2003UnconfirmedVerifyTransaction { + + @SerializedName("burn_factor") + private Integer burnFactor = null; + @SerializedName("max_transaction_size") + private Integer maxTransactionSize = null; + @SerializedName("max_decimals") + private Integer maxDecimals = null; + + /** + **/ + @ApiModelProperty(value = "") + public Integer getBurnFactor() { + return burnFactor; + } + public void setBurnFactor(Integer burnFactor) { + this.burnFactor = burnFactor; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getMaxTransactionSize() { + return maxTransactionSize; + } + public void setMaxTransactionSize(Integer maxTransactionSize) { + this.maxTransactionSize = maxTransactionSize; + } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getMaxDecimals() { + return maxDecimals; + } + public void setMaxDecimals(Integer maxDecimals) { + this.maxDecimals = maxDecimals; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse2003UnconfirmedVerifyTransaction inlineResponse2003UnconfirmedVerifyTransaction = (InlineResponse2003UnconfirmedVerifyTransaction) o; + return (this.burnFactor == null ? inlineResponse2003UnconfirmedVerifyTransaction.burnFactor == null : this.burnFactor.equals(inlineResponse2003UnconfirmedVerifyTransaction.burnFactor)) && + (this.maxTransactionSize == null ? inlineResponse2003UnconfirmedVerifyTransaction.maxTransactionSize == null : this.maxTransactionSize.equals(inlineResponse2003UnconfirmedVerifyTransaction.maxTransactionSize)) && + (this.maxDecimals == null ? inlineResponse2003UnconfirmedVerifyTransaction.maxDecimals == null : this.maxDecimals.equals(inlineResponse2003UnconfirmedVerifyTransaction.maxDecimals)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.burnFactor == null ? 0: this.burnFactor.hashCode()); + result = 31 * result + (this.maxTransactionSize == null ? 0: this.maxTransactionSize.hashCode()); + result = 31 * result + (this.maxDecimals == null ? 0: this.maxDecimals.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse2003UnconfirmedVerifyTransaction {\n"); + + sb.append(" burnFactor: ").append(burnFactor).append("\n"); + sb.append(" maxTransactionSize: ").append(maxTransactionSize).append("\n"); + sb.append(" maxDecimals: ").append(maxDecimals).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2004.java b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2004.java new file mode 100644 index 0000000..fb92984 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2004.java @@ -0,0 +1,124 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.openapitools.client.model.Apiv1pendingTxsTransaction; +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class InlineResponse2004 { + + @SerializedName("announced") + private String announced = null; + @SerializedName("is_valid") + private Boolean isValid = null; + @SerializedName("checked") + private String checked = null; + @SerializedName("received") + private String received = null; + @SerializedName("transaction") + private Apiv1pendingTxsTransaction transaction = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getAnnounced() { + return announced; + } + public void setAnnounced(String announced) { + this.announced = announced; + } + + /** + **/ + @ApiModelProperty(value = "") + public Boolean getIsValid() { + return isValid; + } + public void setIsValid(Boolean isValid) { + this.isValid = isValid; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getChecked() { + return checked; + } + public void setChecked(String checked) { + this.checked = checked; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getReceived() { + return received; + } + public void setReceived(String received) { + this.received = received; + } + + /** + **/ + @ApiModelProperty(value = "") + public Apiv1pendingTxsTransaction getTransaction() { + return transaction; + } + public void setTransaction(Apiv1pendingTxsTransaction transaction) { + this.transaction = transaction; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse2004 inlineResponse2004 = (InlineResponse2004) o; + return (this.announced == null ? inlineResponse2004.announced == null : this.announced.equals(inlineResponse2004.announced)) && + (this.isValid == null ? inlineResponse2004.isValid == null : this.isValid.equals(inlineResponse2004.isValid)) && + (this.checked == null ? inlineResponse2004.checked == null : this.checked.equals(inlineResponse2004.checked)) && + (this.received == null ? inlineResponse2004.received == null : this.received.equals(inlineResponse2004.received)) && + (this.transaction == null ? inlineResponse2004.transaction == null : this.transaction.equals(inlineResponse2004.transaction)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.announced == null ? 0: this.announced.hashCode()); + result = 31 * result + (this.isValid == null ? 0: this.isValid.hashCode()); + result = 31 * result + (this.checked == null ? 0: this.checked.hashCode()); + result = 31 * result + (this.received == null ? 0: this.received.hashCode()); + result = 31 * result + (this.transaction == null ? 0: this.transaction.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse2004 {\n"); + + sb.append(" announced: ").append(announced).append("\n"); + sb.append(" isValid: ").append(isValid).append("\n"); + sb.append(" checked: ").append(checked).append("\n"); + sb.append(" received: ").append(received).append("\n"); + sb.append(" transaction: ").append(transaction).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2005.java b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2005.java new file mode 100644 index 0000000..893438d --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2005.java @@ -0,0 +1,81 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.*; +import org.openapitools.client.model.Apiv1walletsEntries; +import org.openapitools.client.model.Apiv1walletsMeta; +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class InlineResponse2005 { + + @SerializedName("entries") + private List entries = null; + @SerializedName("meta") + private Apiv1walletsMeta meta = null; + + /** + **/ + @ApiModelProperty(value = "") + public List getEntries() { + return entries; + } + public void setEntries(List entries) { + this.entries = entries; + } + + /** + **/ + @ApiModelProperty(value = "") + public Apiv1walletsMeta getMeta() { + return meta; + } + public void setMeta(Apiv1walletsMeta meta) { + this.meta = meta; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse2005 inlineResponse2005 = (InlineResponse2005) o; + return (this.entries == null ? inlineResponse2005.entries == null : this.entries.equals(inlineResponse2005.entries)) && + (this.meta == null ? inlineResponse2005.meta == null : this.meta.equals(inlineResponse2005.meta)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.entries == null ? 0: this.entries.hashCode()); + result = 31 * result + (this.meta == null ? 0: this.meta.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse2005 {\n"); + + sb.append(" entries: ").append(entries).append("\n"); + sb.append(" meta: ").append(meta).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2006.java b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2006.java new file mode 100644 index 0000000..8c8b786 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2006.java @@ -0,0 +1,63 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class InlineResponse2006 { + + @SerializedName("address") + private String address = null; + + /** + **/ + @ApiModelProperty(value = "") + public String getAddress() { + return address; + } + public void setAddress(String address) { + this.address = address; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse2006 inlineResponse2006 = (InlineResponse2006) o; + return (this.address == null ? inlineResponse2006.address == null : this.address.equals(inlineResponse2006.address)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.address == null ? 0: this.address.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse2006 {\n"); + + sb.append(" address: ").append(address).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2007.java b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2007.java new file mode 100644 index 0000000..4807bc5 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2007.java @@ -0,0 +1,79 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.openapitools.client.model.InlineResponse2007Data; +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class InlineResponse2007 { + + @SerializedName("data") + private InlineResponse2007Data data = null; + @SerializedName("error") + private Object error = null; + + /** + **/ + @ApiModelProperty(value = "") + public InlineResponse2007Data getData() { + return data; + } + public void setData(InlineResponse2007Data data) { + this.data = data; + } + + /** + **/ + @ApiModelProperty(value = "") + public Object getError() { + return error; + } + public void setError(Object error) { + this.error = error; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse2007 inlineResponse2007 = (InlineResponse2007) o; + return (this.data == null ? inlineResponse2007.data == null : this.data.equals(inlineResponse2007.data)) && + (this.error == null ? inlineResponse2007.error == null : this.error.equals(inlineResponse2007.error)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.data == null ? 0: this.data.hashCode()); + result = 31 * result + (this.error == null ? 0: this.error.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse2007 {\n"); + + sb.append(" data: ").append(data).append("\n"); + sb.append(" error: ").append(error).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2007Data.java b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2007Data.java new file mode 100644 index 0000000..9d6f442 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponse2007Data.java @@ -0,0 +1,63 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class InlineResponse2007Data { + + @SerializedName("version") + private Long version = null; + + /** + **/ + @ApiModelProperty(value = "") + public Long getVersion() { + return version; + } + public void setVersion(Long version) { + this.version = version; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse2007Data inlineResponse2007Data = (InlineResponse2007Data) o; + return (this.version == null ? inlineResponse2007Data.version == null : this.version.equals(inlineResponse2007Data.version)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.version == null ? 0: this.version.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse2007Data {\n"); + + sb.append(" version: ").append(version).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponseDefault.java new file mode 100644 index 0000000..2fcc4a9 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/model/InlineResponseDefault.java @@ -0,0 +1,78 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + +@ApiModel(description = "") +public class InlineResponseDefault { + + @SerializedName("code") + private Integer code = null; + @SerializedName("message") + private String message = null; + + /** + **/ + @ApiModelProperty(value = "") + public Integer getCode() { + return code; + } + public void setCode(Integer code) { + this.code = code; + } + + /** + **/ + @ApiModelProperty(value = "") + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponseDefault inlineResponseDefault = (InlineResponseDefault) o; + return (this.code == null ? inlineResponseDefault.code == null : this.code.equals(inlineResponseDefault.code)) && + (this.message == null ? inlineResponseDefault.message == null : this.message.equals(inlineResponseDefault.message)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.code == null ? 0: this.code.hashCode()); + result = 31 * result + (this.message == null ? 0: this.message.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponseDefault {\n"); + + sb.append(" code: ").append(code).append("\n"); + sb.append(" message: ").append(message).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/request/DeleteRequest.java b/lib/skyapi/src/main/java/org/openapitools/client/request/DeleteRequest.java new file mode 100644 index 0000000..36e278d --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/request/DeleteRequest.java @@ -0,0 +1,104 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.request; + +import com.android.volley.AuthFailureError; +import com.android.volley.NetworkResponse; +import com.android.volley.Request; +import com.android.volley.Response; +import com.android.volley.VolleyLog; +import com.android.volley.toolbox.HttpHeaderParser; + +import org.apache.http.HttpEntity; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class DeleteRequest extends Request { + + HttpEntity entity; + + private final Response.Listener mListener; + + String contentType; + Map apiHeaders; + public DeleteRequest(String url, Map apiHeaders, String contentType, HttpEntity entity, Response.Listener listener, Response.ErrorListener errorListener) { + super(Method.DELETE, url, errorListener); + mListener = listener; + this.entity = entity; + this.contentType = contentType; + this.apiHeaders = apiHeaders; + } + + @Override + public String getBodyContentType() { + if(entity == null) { + return null; + } + return entity.getContentType().getValue(); + } + + @Override + public byte[] getBody() throws AuthFailureError { + if(entity == null) { + return null; + } + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try { + entity.writeTo(bos); + } + catch (IOException e) { + VolleyLog.e("IOException writing to ByteArrayOutputStream"); + } + return bos.toByteArray(); + } + + @Override + protected Response parseNetworkResponse(NetworkResponse response) { + String parsed; + try { + parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); + } catch (UnsupportedEncodingException e) { + parsed = new String(response.data); + } + return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response)); + } + + @Override + protected void deliverResponse(String response) { + mListener.onResponse(response); + } + + /* (non-Javadoc) + * @see com.android.volley.Request#getHeaders() + */ + @Override + public Map getHeaders() throws AuthFailureError { + Map headers = super.getHeaders(); + if (headers == null || headers.equals(Collections.emptyMap())) { + headers = new HashMap(); + } + if (apiHeaders != null && !apiHeaders.equals(Collections.emptyMap())) { + headers.putAll(apiHeaders); + } + if(contentType != null) { + headers.put("Content-Type", contentType); + } + + return headers; + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/request/GetRequest.java b/lib/skyapi/src/main/java/org/openapitools/client/request/GetRequest.java new file mode 100644 index 0000000..5a535fd --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/request/GetRequest.java @@ -0,0 +1,51 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.request; + +import com.android.volley.AuthFailureError; +import com.android.volley.Response; +import com.android.volley.toolbox.StringRequest; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class GetRequest extends StringRequest{ + Map apiHeaders; + String contentType; + + public GetRequest(String url, Map apiHeaders, String contentType, Response.Listener listener, Response.ErrorListener errorListener) { + super(Method.GET, url, listener, errorListener); + this.apiHeaders = apiHeaders; + this.contentType = contentType; + } + + /* (non-Javadoc) + * @see com.android.volley.Request#getHeaders() + */ + @Override + public Map getHeaders() throws AuthFailureError { + Map headers = super.getHeaders(); + if (headers == null || headers.equals(Collections.emptyMap())) { + headers = new HashMap(); + } + if (apiHeaders != null && !apiHeaders.equals(Collections.emptyMap())) { + headers.putAll(apiHeaders); + } + if(contentType != null) { + headers.put("Content-Type", contentType); + } + + return headers; + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/request/PatchRequest.java b/lib/skyapi/src/main/java/org/openapitools/client/request/PatchRequest.java new file mode 100644 index 0000000..9e079be --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/request/PatchRequest.java @@ -0,0 +1,104 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.request; + +import com.android.volley.AuthFailureError; +import com.android.volley.NetworkResponse; +import com.android.volley.Request; +import com.android.volley.Response; +import com.android.volley.VolleyLog; +import com.android.volley.toolbox.HttpHeaderParser; + +import org.apache.http.HttpEntity; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class PatchRequest extends Request { + + HttpEntity entity; + + private final Response.Listener mListener; + + String contentType; + Map apiHeaders; + public PatchRequest(String url, Map apiHeaders, String contentType, HttpEntity entity, Response.Listener listener, Response.ErrorListener errorListener) { + super(Method.PATCH, url, errorListener); + mListener = listener; + this.entity = entity; + this.contentType = contentType; + this.apiHeaders = apiHeaders; + } + + @Override + public String getBodyContentType() { + if(entity == null) { + return null; + } + return entity.getContentType().getValue(); + } + + @Override + public byte[] getBody() throws AuthFailureError { + if(entity == null) { + return null; + } + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try { + entity.writeTo(bos); + } + catch (IOException e) { + VolleyLog.e("IOException writing to ByteArrayOutputStream"); + } + return bos.toByteArray(); + } + + @Override + protected Response parseNetworkResponse(NetworkResponse response) { + String parsed; + try { + parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); + } catch (UnsupportedEncodingException e) { + parsed = new String(response.data); + } + return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response)); + } + + @Override + protected void deliverResponse(String response) { + mListener.onResponse(response); + } + + /* (non-Javadoc) + * @see com.android.volley.Request#getHeaders() + */ + @Override + public Map getHeaders() throws AuthFailureError { + Map headers = super.getHeaders(); + if (headers == null || headers.equals(Collections.emptyMap())) { + headers = new HashMap(); + } + if (apiHeaders != null && !apiHeaders.equals(Collections.emptyMap())) { + headers.putAll(apiHeaders); + } + if(contentType != null) { + headers.put("Content-Type", contentType); + } + + return headers; + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/request/PostRequest.java b/lib/skyapi/src/main/java/org/openapitools/client/request/PostRequest.java new file mode 100644 index 0000000..9be0621 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/request/PostRequest.java @@ -0,0 +1,104 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.request; + +import com.android.volley.AuthFailureError; +import com.android.volley.NetworkResponse; +import com.android.volley.Request; +import com.android.volley.Response; +import com.android.volley.VolleyLog; +import com.android.volley.toolbox.HttpHeaderParser; + +import org.apache.http.HttpEntity; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class PostRequest extends Request { + + HttpEntity entity; + + private final Response.Listener mListener; + + String contentType; + Map apiHeaders; + public PostRequest(String url, Map apiHeaders, String contentType, HttpEntity entity, Response.Listener listener, Response.ErrorListener errorListener) { + super(Method.POST, url, errorListener); + mListener = listener; + this.entity = entity; + this.contentType = contentType; + this.apiHeaders = apiHeaders; + } + + @Override + public String getBodyContentType() { + if(entity == null) { + return null; + } + return entity.getContentType().getValue(); + } + + @Override + public byte[] getBody() throws AuthFailureError { + if(entity == null) { + return null; + } + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try { + entity.writeTo(bos); + } + catch (IOException e) { + VolleyLog.e("IOException writing to ByteArrayOutputStream"); + } + return bos.toByteArray(); + } + + @Override + protected Response parseNetworkResponse(NetworkResponse response) { + String parsed; + try { + parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); + } catch (UnsupportedEncodingException e) { + parsed = new String(response.data); + } + return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response)); + } + + @Override + protected void deliverResponse(String response) { + mListener.onResponse(response); + } + + /* (non-Javadoc) + * @see com.android.volley.Request#getHeaders() + */ + @Override + public Map getHeaders() throws AuthFailureError { + Map headers = super.getHeaders(); + if (headers == null || headers.equals(Collections.emptyMap())) { + headers = new HashMap(); + } + if (apiHeaders != null && !apiHeaders.equals(Collections.emptyMap())) { + headers.putAll(apiHeaders); + } + if(contentType != null) { + headers.put("Content-Type", contentType); + } + + return headers; + } +} diff --git a/lib/skyapi/src/main/java/org/openapitools/client/request/PutRequest.java b/lib/skyapi/src/main/java/org/openapitools/client/request/PutRequest.java new file mode 100644 index 0000000..dbe2fe5 --- /dev/null +++ b/lib/skyapi/src/main/java/org/openapitools/client/request/PutRequest.java @@ -0,0 +1,104 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.request; + +import com.android.volley.AuthFailureError; +import com.android.volley.NetworkResponse; +import com.android.volley.Request; +import com.android.volley.Response; +import com.android.volley.VolleyLog; +import com.android.volley.toolbox.HttpHeaderParser; + +import org.apache.http.HttpEntity; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class PutRequest extends Request { + + HttpEntity entity; + + private final Response.Listener mListener; + + String contentType; + Map apiHeaders; + public PutRequest(String url, Map apiHeaders, String contentType, HttpEntity entity, Response.Listener listener, Response.ErrorListener errorListener) { + super(Method.PUT, url, errorListener); + mListener = listener; + this.entity = entity; + this.contentType = contentType; + this.apiHeaders = apiHeaders; + } + + @Override + public String getBodyContentType() { + if(entity == null) { + return null; + } + return entity.getContentType().getValue(); + } + + @Override + public byte[] getBody() throws AuthFailureError { + if(entity == null) { + return null; + } + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try { + entity.writeTo(bos); + } + catch (IOException e) { + VolleyLog.e("IOException writing to ByteArrayOutputStream"); + } + return bos.toByteArray(); + } + + @Override + protected Response parseNetworkResponse(NetworkResponse response) { + String parsed; + try { + parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); + } catch (UnsupportedEncodingException e) { + parsed = new String(response.data); + } + return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response)); + } + + @Override + protected void deliverResponse(String response) { + mListener.onResponse(response); + } + + /* (non-Javadoc) + * @see com.android.volley.Request#getHeaders() + */ + @Override + public Map getHeaders() throws AuthFailureError { + Map headers = super.getHeaders(); + if (headers == null || headers.equals(Collections.emptyMap())) { + headers = new HashMap(); + } + if (apiHeaders != null && !apiHeaders.equals(Collections.emptyMap())) { + headers.putAll(apiHeaders); + } + if(contentType != null) { + headers.put("Content-Type", contentType); + } + + return headers; + } +} diff --git a/lib/skyapi/src/main/java/skycoin/DefaultApi.java b/lib/skyapi/src/main/java/skycoin/DefaultApi.java new file mode 100644 index 0000000..1204f90 --- /dev/null +++ b/lib/skyapi/src/main/java/skycoin/DefaultApi.java @@ -0,0 +1,6461 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package skycoin; + +import org.openapitools.client.ApiInvoker; +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import org.openapitools.client.model.*; + +import java.util.*; + +import com.android.volley.Response; +import com.android.volley.VolleyError; + +import org.openapitools.client.model.InlineObject; +import org.openapitools.client.model.InlineResponse200; +import org.openapitools.client.model.InlineResponse2001; +import org.openapitools.client.model.InlineResponse2002; +import org.openapitools.client.model.InlineResponse2003; +import org.openapitools.client.model.InlineResponse2004; +import org.openapitools.client.model.InlineResponse2005; +import org.openapitools.client.model.InlineResponse2006; +import org.openapitools.client.model.InlineResponse2007; +import org.openapitools.client.model.InlineResponseDefault; + +import org.apache.http.HttpEntity; +import org.apache.http.entity.mime.MultipartEntityBuilder; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +public class DefaultApi { + String basePath = "http://127.0.0.1:6420"; + ApiInvoker apiInvoker = ApiInvoker.getInstance(); + + public void addHeader(String key, String value) { + getInvoker().addDefaultHeader(key, value); + } + + public ApiInvoker getInvoker() { + return apiInvoker; + } + + public void setBasePath(String basePath) { + this.basePath = basePath; + } + + public String getBasePath() { + return basePath; + } + + /** + * Returns the total number of unique address that have coins. + * + * @return Object + */ + public Object addressCount () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/addresscount"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns the total number of unique address that have coins. + * + + */ + public void addressCount (final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/addresscount".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Returns the historical, spent outputs associated with an address + * @param address address to filter by + * @return List + */ + public List addressUxouts (String address) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'address' is set + if (address == null) { + VolleyError error = new VolleyError("Missing the required parameter 'address' when calling addressUxouts", + new ApiException(400, "Missing the required parameter 'address' when calling addressUxouts")); + } + + // create path and map variables + String path = "/api/v1/address_uxouts"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "address", address)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (List) ApiInvoker.deserialize(localVarResponse, "array", InlineResponse200.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Returns the historical, spent outputs associated with an address + * @param address address to filter by + */ + public void addressUxouts (String address, final Response.Listener> responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'address' is set + if (address == null) { + VolleyError error = new VolleyError("Missing the required parameter 'address' when calling addressUxouts", + new ApiException(400, "Missing the required parameter 'address' when calling addressUxouts")); + } + + // create path and map variables + String path = "/api/v1/address_uxouts".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "address", address)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((List) ApiInvoker.deserialize(localVarResponse, "array", InlineResponse200.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + * + * @param addrs command separated list of addresses + * @return Object + */ + public Object balanceGet (String addrs) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'addrs' is set + if (addrs == null) { + VolleyError error = new VolleyError("Missing the required parameter 'addrs' when calling balanceGet", + new ApiException(400, "Missing the required parameter 'addrs' when calling balanceGet")); + } + + // create path and map variables + String path = "/api/v1/balance"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "addrs", addrs)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + * + * @param addrs command separated list of addresses + */ + public void balanceGet (String addrs, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'addrs' is set + if (addrs == null) { + VolleyError error = new VolleyError("Missing the required parameter 'addrs' when calling balanceGet", + new ApiException(400, "Missing the required parameter 'addrs' when calling balanceGet")); + } + + // create path and map variables + String path = "/api/v1/balance".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "addrs", addrs)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + * + * @param addrs command separated list of addresses + * @return Object + */ + public Object balancePost (String addrs) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'addrs' is set + if (addrs == null) { + VolleyError error = new VolleyError("Missing the required parameter 'addrs' when calling balancePost", + new ApiException(400, "Missing the required parameter 'addrs' when calling balancePost")); + } + + // create path and map variables + String path = "/api/v1/balance"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "addrs", addrs)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + * + * @param addrs command separated list of addresses + */ + public void balancePost (String addrs, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'addrs' is set + if (addrs == null) { + VolleyError error = new VolleyError("Missing the required parameter 'addrs' when calling balancePost", + new ApiException(400, "Missing the required parameter 'addrs' when calling balancePost")); + } + + // create path and map variables + String path = "/api/v1/balance".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "addrs", addrs)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Returns a block by hash or seq. Note: only one of hash or seq is allowed + * @param hash + * @param seq + * @return Object + */ + public Object block (String hash, Integer seq) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/block"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "hash", hash)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "seq", seq)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Returns a block by hash or seq. Note: only one of hash or seq is allowed + * @param hash * @param seq + */ + public void block (String hash, Integer seq, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/block".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "hash", hash)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "seq", seq)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns the blockchain metadata. + * + * @return Object + */ + public Object blockchainMetadata () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/blockchain/metadata"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns the blockchain metadata. + * + + */ + public void blockchainMetadata (final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/blockchain/metadata".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns the blockchain sync progress. + * + * @return Object + */ + public Object blockchainProgress () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/blockchain/progress"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns the blockchain sync progress. + * + + */ + public void blockchainProgress (final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/blockchain/progress".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * blocksHandler returns blocks between a start and end point, + * or an explicit list of sequences. If using start and end, the block sequences include both the start and end point. Explicit sequences cannot be combined with start and end. Without verbose. + * @param start + * @param end + * @param seqs + * @return Object + */ + public Object blocksGet (Integer start, Integer end, List seqs) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/blocks"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "start", start)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "end", end)); + queryParams.addAll(ApiInvoker.parameterToPairs("csv", "seqs", seqs)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * blocksHandler returns blocks between a start and end point, + * or an explicit list of sequences. If using start and end, the block sequences include both the start and end point. Explicit sequences cannot be combined with start and end. Without verbose. + * @param start * @param end * @param seqs + */ + public void blocksGet (Integer start, Integer end, List seqs, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/blocks".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "start", start)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "end", end)); + queryParams.addAll(ApiInvoker.parameterToPairs("csv", "seqs", seqs)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * blocksHandler returns blocks between a start and end point, + * or an explicit list of sequences. If using start and end, the block sequences include both the start and end point. Explicit sequences cannot be combined with start and end. Without verbose + * @param start + * @param end + * @param seqs + * @return Object + */ + public Object blocksPost (Integer start, Integer end, List seqs) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/blocks"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "start", start)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "end", end)); + queryParams.addAll(ApiInvoker.parameterToPairs("csv", "seqs", seqs)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * blocksHandler returns blocks between a start and end point, + * or an explicit list of sequences. If using start and end, the block sequences include both the start and end point. Explicit sequences cannot be combined with start and end. Without verbose + * @param start * @param end * @param seqs + */ + public void blocksPost (Integer start, Integer end, List seqs, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/blocks".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "start", start)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "end", end)); + queryParams.addAll(ApiInvoker.parameterToPairs("csv", "seqs", seqs)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * coinSupplyHandler returns coin distribution supply stats + * @return void + */ + public void coinSupply () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/coinSupply"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * coinSupplyHandler returns coin distribution supply stats + + */ + public void coinSupply (final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/coinSupply".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. + * + * @return InlineResponse2001 + */ + public InlineResponse2001 csrf () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/csrf"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (InlineResponse2001) ApiInvoker.deserialize(localVarResponse, "", InlineResponse2001.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. + * + + */ + public void csrf (final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/csrf".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((InlineResponse2001) ApiInvoker.deserialize(localVarResponse, "", InlineResponse2001.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. + * + * @return List + */ + public List defaultConnections () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/network/defaultConnections"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (List) ApiInvoker.deserialize(localVarResponse, "array", String.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. + * + + */ + public void defaultConnections (final Response.Listener> responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/network/defaultConnections".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((List) ApiInvoker.deserialize(localVarResponse, "array", String.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Returns all transactions (confirmed and unconfirmed) for an address + * @param address tags to filter by + * @return List + */ + public List explorerAddress (String address) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/explorer/address"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "address", address)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (List) ApiInvoker.deserialize(localVarResponse, "array", InlineResponse2002.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Returns all transactions (confirmed and unconfirmed) for an address + * @param address tags to filter by + */ + public void explorerAddress (String address, final Response.Listener> responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/explorer/address".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "address", address)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((List) ApiInvoker.deserialize(localVarResponse, "array", InlineResponse2002.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns node health data. + * + * @return Object + */ + public Object health () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/health"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns node health data. + * + + */ + public void health (final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/health".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Returns the most recent N blocks on the blockchain + * @param num + * @return Object + */ + public Object lastBlocks (Integer num) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'num' is set + if (num == null) { + VolleyError error = new VolleyError("Missing the required parameter 'num' when calling lastBlocks", + new ApiException(400, "Missing the required parameter 'num' when calling lastBlocks")); + } + + // create path and map variables + String path = "/api/v1/last_blocks"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "num", num)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Returns the most recent N blocks on the blockchain + * @param num + */ + public void lastBlocks (Integer num, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'num' is set + if (num == null) { + VolleyError error = new VolleyError("Missing the required parameter 'num' when calling lastBlocks", + new ApiException(400, "Missing the required parameter 'num' when calling lastBlocks")); + } + + // create path and map variables + String path = "/api/v1/last_blocks".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "num", num)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * This endpoint returns a specific connection. + * + * @param addr Address port + * @return InlineResponse2003 + */ + public InlineResponse2003 networkConnection (String addr) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'addr' is set + if (addr == null) { + VolleyError error = new VolleyError("Missing the required parameter 'addr' when calling networkConnection", + new ApiException(400, "Missing the required parameter 'addr' when calling networkConnection")); + } + + // create path and map variables + String path = "/api/v1/network/connection"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "addr", addr)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (InlineResponse2003) ApiInvoker.deserialize(localVarResponse, "", InlineResponse2003.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * This endpoint returns a specific connection. + * + * @param addr Address port + */ + public void networkConnection (String addr, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'addr' is set + if (addr == null) { + VolleyError error = new VolleyError("Missing the required parameter 'addr' when calling networkConnection", + new ApiException(400, "Missing the required parameter 'addr' when calling networkConnection")); + } + + // create path and map variables + String path = "/api/v1/network/connection".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "addr", addr)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((InlineResponse2003) ApiInvoker.deserialize(localVarResponse, "", InlineResponse2003.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * This endpoint returns all outgoings connections. + * + * @param states Connection status. + * @param direction Direction of the connection. + * @return List + */ + public List networkConnections (String states, String direction) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/network/connections"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "states", states)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "direction", direction)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (List) ApiInvoker.deserialize(localVarResponse, "array", InlineResponse2003.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * This endpoint returns all outgoings connections. + * + * @param states Connection status. * @param direction Direction of the connection. + */ + public void networkConnections (String states, String direction, final Response.Listener> responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/network/connections".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "states", states)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "direction", direction)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((List) ApiInvoker.deserialize(localVarResponse, "array", InlineResponse2003.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * This endpoint disconnects a connection by ID or address + * @param id Address id. + * @return void + */ + public void networkConnectionsDisconnect (String id) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling networkConnectionsDisconnect", + new ApiException(400, "Missing the required parameter 'id' when calling networkConnectionsDisconnect")); + } + + // create path and map variables + String path = "/api/v1/network/connection/disconnect"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * This endpoint disconnects a connection by ID or address + * @param id Address id. + */ + public void networkConnectionsDisconnect (String id, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling networkConnectionsDisconnect", + new ApiException(400, "Missing the required parameter 'id' when calling networkConnectionsDisconnect")); + } + + // create path and map variables + String path = "/api/v1/network/connection/disconnect".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * This endpoint returns all connections found through peer exchange + * @return List + */ + public List networkConnectionsExchange () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/network/connections/exchange"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (List) ApiInvoker.deserialize(localVarResponse, "array", String.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * This endpoint returns all connections found through peer exchange + + */ + public void networkConnectionsExchange (final Response.Listener> responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/network/connections/exchange".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((List) ApiInvoker.deserialize(localVarResponse, "array", String.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * 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. + * + * @return List + */ + public List networkConnectionsTrust () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/network/connections/trust"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (List) ApiInvoker.deserialize(localVarResponse, "array", String.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * 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. + * + + */ + public void networkConnectionsTrust (final Response.Listener> responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/network/connections/trust".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((List) ApiInvoker.deserialize(localVarResponse, "array", String.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * If neither addrs nor hashes are specificed, return all unspent outputs. If only one filter is specified, then return outputs match the filter. Both filters cannot be specified. + * + * @param address + * @param hash + * @return Object + */ + public Object outputsGet (List address, List hash) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/outputs"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("csv", "address", address)); + queryParams.addAll(ApiInvoker.parameterToPairs("csv", "hash", hash)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * If neither addrs nor hashes are specificed, return all unspent outputs. If only one filter is specified, then return outputs match the filter. Both filters cannot be specified. + * + * @param address * @param hash + */ + public void outputsGet (List address, List hash, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/outputs".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("csv", "address", address)); + queryParams.addAll(ApiInvoker.parameterToPairs("csv", "hash", hash)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * If neither addrs nor hashes are specificed, return all unspent outputs. If only one filter is specified, then return outputs match the filter. Both filters cannot be specified. + * + * @param address + * @param hash + * @return Object + */ + public Object outputsPost (String address, String hash) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/outputs"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "address", address)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "hash", hash)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * If neither addrs nor hashes are specificed, return all unspent outputs. If only one filter is specified, then return outputs match the filter. Both filters cannot be specified. + * + * @param address * @param hash + */ + public void outputsPost (String address, String hash, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/outputs".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "address", address)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "hash", hash)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Returns pending (unconfirmed) transactions without verbose + * @return List + */ + public List pendingTxs () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/pendingTxs"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (List) ApiInvoker.deserialize(localVarResponse, "array", InlineResponse2004.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Returns pending (unconfirmed) transactions without verbose + + */ + public void pendingTxs (final Response.Listener> responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/pendingTxs".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((List) ApiInvoker.deserialize(localVarResponse, "array", InlineResponse2004.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Broadcasts all unconfirmed transactions from the unconfirmed transaction pool + * @return void + */ + public void resendUnconfirmedTxns () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/resendUnconfirmedTxns"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Broadcasts all unconfirmed transactions from the unconfirmed transaction pool + + */ + public void resendUnconfirmedTxns (final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/resendUnconfirmedTxns".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns the top skycoin holders. + * + * @param includeDistribution include distribution addresses or not, default value false + * @param n include distribution addresses or not, default value false + * @return Object + */ + public Object richlist (Boolean includeDistribution, String n) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/richlist"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "include-distribution", includeDistribution)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "n", n)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns the top skycoin holders. + * + * @param includeDistribution include distribution addresses or not, default value false * @param n include distribution addresses or not, default value false + */ + public void richlist (Boolean includeDistribution, String n, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/richlist".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "include-distribution", includeDistribution)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "n", n)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Returns a transaction identified by its txid hash with just id + * @param txid transaction hash + * @param encoded return as a raw encoded transaction. + * @return Object + */ + public Object transaction (String txid, Boolean encoded) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'txid' is set + if (txid == null) { + VolleyError error = new VolleyError("Missing the required parameter 'txid' when calling transaction", + new ApiException(400, "Missing the required parameter 'txid' when calling transaction")); + } + + // create path and map variables + String path = "/api/v1/transaction"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "txid", txid)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "encoded", encoded)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Returns a transaction identified by its txid hash with just id + * @param txid transaction hash * @param encoded return as a raw encoded transaction. + */ + public void transaction (String txid, Boolean encoded, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'txid' is set + if (txid == null) { + VolleyError error = new VolleyError("Missing the required parameter 'txid' when calling transaction", + new ApiException(400, "Missing the required parameter 'txid' when calling transaction")); + } + + // create path and map variables + String path = "/api/v1/transaction".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "txid", txid)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "encoded", encoded)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Broadcast a hex-encoded, serialized transaction to the network. + * + * @param rawtx hex-encoded serialized transaction string. + * @return Object + */ + public Object transactionInject (String rawtx) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'rawtx' is set + if (rawtx == null) { + VolleyError error = new VolleyError("Missing the required parameter 'rawtx' when calling transactionInject", + new ApiException(400, "Missing the required parameter 'rawtx' when calling transactionInject")); + } + + // create path and map variables + String path = "/api/v2/transaction/inject"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + headerParams.put("rawtx", ApiInvoker.parameterToString(rawtx)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Broadcast a hex-encoded, serialized transaction to the network. + * + * @param rawtx hex-encoded serialized transaction string. + */ + public void transactionInject (String rawtx, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'rawtx' is set + if (rawtx == null) { + VolleyError error = new VolleyError("Missing the required parameter 'rawtx' when calling transactionInject", + new ApiException(400, "Missing the required parameter 'rawtx' when calling transactionInject")); + } + + // create path and map variables + String path = "/api/v2/transaction/inject".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("rawtx", ApiInvoker.parameterToString(rawtx)); + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. + * + * @param txid Transaction id hash + * @return Object + */ + public Object transactionRaw (String txid) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v2/transaction/raw"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "txid", txid)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. + * + * @param txid Transaction id hash + */ + public void transactionRaw (String txid, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v2/transaction/raw".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "txid", txid)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Decode and verify an encoded transaction + * @return Object + */ + public Object transactionVerify () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v2/transaction/verify"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Decode and verify an encoded transaction + + */ + public void transactionVerify (final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v2/transaction/verify".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns transactions that match the filters. + * + * @param addrs command separated list of addresses + * @param confirmed Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] + * @return Object + */ + public Object transactionsGet (String addrs, String confirmed) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/transactions"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "addrs", addrs)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "confirmed", confirmed)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns transactions that match the filters. + * + * @param addrs command separated list of addresses * @param confirmed Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] + */ + public void transactionsGet (String addrs, String confirmed, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/transactions".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "addrs", addrs)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "confirmed", confirmed)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns transactions that match the filters. + * + * @param addrs command separated list of addresses + * @param confirmed Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] + * @return Object + */ + public Object transactionsPost (String addrs, String confirmed) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/transactions"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "addrs", addrs)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "confirmed", confirmed)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns transactions that match the filters. + * + * @param addrs command separated list of addresses * @param confirmed Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] + */ + public void transactionsPost (String addrs, String confirmed, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/transactions".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "addrs", addrs)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "confirmed", confirmed)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns an unspent output by ID. + * + * @param uxid uxid to filter by + * @return Object + */ + public Object uxout (String uxid) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/uxout"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "uxid", uxid)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns an unspent output by ID. + * + * @param uxid uxid to filter by + */ + public void uxout (String uxid, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/uxout".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "uxid", uxid)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Verifies a Skycoin address. + * + * @param address Address id. + * @return InlineResponse2007 + */ + public InlineResponse2007 verifyAddress (String address) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'address' is set + if (address == null) { + VolleyError error = new VolleyError("Missing the required parameter 'address' when calling verifyAddress", + new ApiException(400, "Missing the required parameter 'address' when calling verifyAddress")); + } + + // create path and map variables + String path = "/api/v2/address/verify"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "address", address)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (InlineResponse2007) ApiInvoker.deserialize(localVarResponse, "", InlineResponse2007.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Verifies a Skycoin address. + * + * @param address Address id. + */ + public void verifyAddress (String address, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'address' is set + if (address == null) { + VolleyError error = new VolleyError("Missing the required parameter 'address' when calling verifyAddress", + new ApiException(400, "Missing the required parameter 'address' when calling verifyAddress")); + } + + // create path and map variables + String path = "/api/v2/address/verify".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "address", address)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((InlineResponse2007) ApiInvoker.deserialize(localVarResponse, "", InlineResponse2007.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * versionHandler returns the application version info + * @return void + */ + public void version () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/version"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * versionHandler returns the application version info + + */ + public void version (final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/version".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns a wallet by id. + * + * @param id tags to filter by + * @return Object + */ + public Object wallet (String id) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling wallet", + new ApiException(400, "Missing the required parameter 'id' when calling wallet")); + } + + // create path and map variables + String path = "/api/v1/wallet"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns a wallet by id. + * + * @param id tags to filter by + */ + public void wallet (String id, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling wallet", + new ApiException(400, "Missing the required parameter 'id' when calling wallet")); + } + + // create path and map variables + String path = "/api/v1/wallet".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Returns the wallet's balance, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + * + * @param id tags to filter by + * @return Object + */ + public Object walletBalance (String id) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletBalance", + new ApiException(400, "Missing the required parameter 'id' when calling walletBalance")); + } + + // create path and map variables + String path = "/api/v1/wallet/balance"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Returns the wallet's balance, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + * + * @param id tags to filter by + */ + public void walletBalance (String id, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletBalance", + new ApiException(400, "Missing the required parameter 'id' when calling walletBalance")); + } + + // create path and map variables + String path = "/api/v1/wallet/balance".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Loads wallet from seed, will scan ahead N address and load addresses till the last one that have coins. + * @param seed Wallet seed. + * @param label Wallet label. + * @param scan The number of addresses to scan ahead for balances. + * @param encrypt Encrypt wallet. + * @param password Wallet Password + * @return Object + */ + public Object walletCreate (String seed, String label, Integer scan, Boolean encrypt, String password) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'seed' is set + if (seed == null) { + VolleyError error = new VolleyError("Missing the required parameter 'seed' when calling walletCreate", + new ApiException(400, "Missing the required parameter 'seed' when calling walletCreate")); + } + // verify the required parameter 'label' is set + if (label == null) { + VolleyError error = new VolleyError("Missing the required parameter 'label' when calling walletCreate", + new ApiException(400, "Missing the required parameter 'label' when calling walletCreate")); + } + + // create path and map variables + String path = "/api/v1/wallet/create"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + headerParams.put("seed", ApiInvoker.parameterToString(seed)); + headerParams.put("label", ApiInvoker.parameterToString(label)); + headerParams.put("scan", ApiInvoker.parameterToString(scan)); + headerParams.put("encrypt", ApiInvoker.parameterToString(encrypt)); + headerParams.put("password", ApiInvoker.parameterToString(password)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Loads wallet from seed, will scan ahead N address and load addresses till the last one that have coins. + * @param seed Wallet seed. * @param label Wallet label. * @param scan The number of addresses to scan ahead for balances. * @param encrypt Encrypt wallet. * @param password Wallet Password + */ + public void walletCreate (String seed, String label, Integer scan, Boolean encrypt, String password, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'seed' is set + if (seed == null) { + VolleyError error = new VolleyError("Missing the required parameter 'seed' when calling walletCreate", + new ApiException(400, "Missing the required parameter 'seed' when calling walletCreate")); + } + // verify the required parameter 'label' is set + if (label == null) { + VolleyError error = new VolleyError("Missing the required parameter 'label' when calling walletCreate", + new ApiException(400, "Missing the required parameter 'label' when calling walletCreate")); + } + + // create path and map variables + String path = "/api/v1/wallet/create".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("seed", ApiInvoker.parameterToString(seed)); + headerParams.put("label", ApiInvoker.parameterToString(label)); + headerParams.put("scan", ApiInvoker.parameterToString(scan)); + headerParams.put("encrypt", ApiInvoker.parameterToString(encrypt)); + headerParams.put("password", ApiInvoker.parameterToString(password)); + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Decrypts wallet. + * + * @param id Wallet id. + * @param password Wallet password. + * @return Object + */ + public Object walletDecrypt (String id, String password) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletDecrypt", + new ApiException(400, "Missing the required parameter 'id' when calling walletDecrypt")); + } + // verify the required parameter 'password' is set + if (password == null) { + VolleyError error = new VolleyError("Missing the required parameter 'password' when calling walletDecrypt", + new ApiException(400, "Missing the required parameter 'password' when calling walletDecrypt")); + } + + // create path and map variables + String path = "/api/v1/wallet/decrypt"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + headerParams.put("id", ApiInvoker.parameterToString(id)); + headerParams.put("password", ApiInvoker.parameterToString(password)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Decrypts wallet. + * + * @param id Wallet id. * @param password Wallet password. + */ + public void walletDecrypt (String id, String password, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletDecrypt", + new ApiException(400, "Missing the required parameter 'id' when calling walletDecrypt")); + } + // verify the required parameter 'password' is set + if (password == null) { + VolleyError error = new VolleyError("Missing the required parameter 'password' when calling walletDecrypt", + new ApiException(400, "Missing the required parameter 'password' when calling walletDecrypt")); + } + + // create path and map variables + String path = "/api/v1/wallet/decrypt".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("id", ApiInvoker.parameterToString(id)); + headerParams.put("password", ApiInvoker.parameterToString(password)); + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Encrypt wallet. + * + * @param id Wallet id. + * @param password Wallet password. + * @return Object + */ + public Object walletEncrypt (String id, String password) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletEncrypt", + new ApiException(400, "Missing the required parameter 'id' when calling walletEncrypt")); + } + // verify the required parameter 'password' is set + if (password == null) { + VolleyError error = new VolleyError("Missing the required parameter 'password' when calling walletEncrypt", + new ApiException(400, "Missing the required parameter 'password' when calling walletEncrypt")); + } + + // create path and map variables + String path = "/api/v1/wallet/encrypt"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + headerParams.put("id", ApiInvoker.parameterToString(id)); + headerParams.put("password", ApiInvoker.parameterToString(password)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Encrypt wallet. + * + * @param id Wallet id. * @param password Wallet password. + */ + public void walletEncrypt (String id, String password, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletEncrypt", + new ApiException(400, "Missing the required parameter 'id' when calling walletEncrypt")); + } + // verify the required parameter 'password' is set + if (password == null) { + VolleyError error = new VolleyError("Missing the required parameter 'password' when calling walletEncrypt", + new ApiException(400, "Missing the required parameter 'password' when calling walletEncrypt")); + } + + // create path and map variables + String path = "/api/v1/wallet/encrypt".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("id", ApiInvoker.parameterToString(id)); + headerParams.put("password", ApiInvoker.parameterToString(password)); + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Returns the wallet directory path + * @param addr Address port + * @return InlineResponse2006 + */ + public InlineResponse2006 walletFolder (String addr) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'addr' is set + if (addr == null) { + VolleyError error = new VolleyError("Missing the required parameter 'addr' when calling walletFolder", + new ApiException(400, "Missing the required parameter 'addr' when calling walletFolder")); + } + + // create path and map variables + String path = "/api/v1/wallets/folderName"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "addr", addr)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (InlineResponse2006) ApiInvoker.deserialize(localVarResponse, "", InlineResponse2006.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Returns the wallet directory path + * @param addr Address port + */ + public void walletFolder (String addr, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'addr' is set + if (addr == null) { + VolleyError error = new VolleyError("Missing the required parameter 'addr' when calling walletFolder", + new ApiException(400, "Missing the required parameter 'addr' when calling walletFolder")); + } + + // create path and map variables + String path = "/api/v1/wallets/folderName".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "addr", addr)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((InlineResponse2006) ApiInvoker.deserialize(localVarResponse, "", InlineResponse2006.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Generates new addresses + * @param id Wallet Id + * @param num The number you want to generate + * @param password Wallet Password + * @return Object + */ + public Object walletNewAddress (String id, String num, String password) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletNewAddress", + new ApiException(400, "Missing the required parameter 'id' when calling walletNewAddress")); + } + + // create path and map variables + String path = "/api/v1/wallet/newAddress"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "num", num)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "password", password)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Generates new addresses + * @param id Wallet Id * @param num The number you want to generate * @param password Wallet Password + */ + public void walletNewAddress (String id, String num, String password, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletNewAddress", + new ApiException(400, "Missing the required parameter 'id' when calling walletNewAddress")); + } + + // create path and map variables + String path = "/api/v1/wallet/newAddress".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "num", num)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "password", password)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Returns the wallet directory path + * @param entropy Entropy bitSize. + * @return Object + */ + public Object walletNewSeed (String entropy) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/wallet/newSeed"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "entropy", entropy)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Returns the wallet directory path + * @param entropy Entropy bitSize. + */ + public void walletNewSeed (String entropy, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/wallet/newSeed".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "entropy", entropy)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Recovers an encrypted wallet by providing the seed. The first address will be generated from seed and compared to the first address of the specified wallet. If they match, the wallet will be regenerated with an optional password. If the wallet is not encrypted, an error is returned. + * + * @param id Wallet id. + * @param seed Wallet seed. + * @param password Wallet password. + * @return Object + */ + public Object walletRecover (String id, String seed, String password) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletRecover", + new ApiException(400, "Missing the required parameter 'id' when calling walletRecover")); + } + // verify the required parameter 'seed' is set + if (seed == null) { + VolleyError error = new VolleyError("Missing the required parameter 'seed' when calling walletRecover", + new ApiException(400, "Missing the required parameter 'seed' when calling walletRecover")); + } + + // create path and map variables + String path = "/api/v2/wallet/recover"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + headerParams.put("id", ApiInvoker.parameterToString(id)); + headerParams.put("seed", ApiInvoker.parameterToString(seed)); + headerParams.put("password", ApiInvoker.parameterToString(password)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Recovers an encrypted wallet by providing the seed. The first address will be generated from seed and compared to the first address of the specified wallet. If they match, the wallet will be regenerated with an optional password. If the wallet is not encrypted, an error is returned. + * + * @param id Wallet id. * @param seed Wallet seed. * @param password Wallet password. + */ + public void walletRecover (String id, String seed, String password, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletRecover", + new ApiException(400, "Missing the required parameter 'id' when calling walletRecover")); + } + // verify the required parameter 'seed' is set + if (seed == null) { + VolleyError error = new VolleyError("Missing the required parameter 'seed' when calling walletRecover", + new ApiException(400, "Missing the required parameter 'seed' when calling walletRecover")); + } + + // create path and map variables + String path = "/api/v2/wallet/recover".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("id", ApiInvoker.parameterToString(id)); + headerParams.put("seed", ApiInvoker.parameterToString(seed)); + headerParams.put("password", ApiInvoker.parameterToString(password)); + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * This endpoint only works for encrypted wallets. If the wallet is unencrypted, The seed will be not returned. + * + * @param id Wallet Id. + * @param password Wallet password. + * @return Object + */ + public Object walletSeed (String id, String password) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletSeed", + new ApiException(400, "Missing the required parameter 'id' when calling walletSeed")); + } + // verify the required parameter 'password' is set + if (password == null) { + VolleyError error = new VolleyError("Missing the required parameter 'password' when calling walletSeed", + new ApiException(400, "Missing the required parameter 'password' when calling walletSeed")); + } + + // create path and map variables + String path = "/api/v1/wallet/seed"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "password", password)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * This endpoint only works for encrypted wallets. If the wallet is unencrypted, The seed will be not returned. + * + * @param id Wallet Id. * @param password Wallet password. + */ + public void walletSeed (String id, String password, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletSeed", + new ApiException(400, "Missing the required parameter 'id' when calling walletSeed")); + } + // verify the required parameter 'password' is set + if (password == null) { + VolleyError error = new VolleyError("Missing the required parameter 'password' when calling walletSeed", + new ApiException(400, "Missing the required parameter 'password' when calling walletSeed")); + } + + // create path and map variables + String path = "/api/v1/wallet/seed".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "password", password)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Verifies a wallet seed. + * + * @param seed Seed to be verified. + * @return Object + */ + public Object walletSeedVerify (String seed) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v2/wallet/seed/verify"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + headerParams.put("seed", ApiInvoker.parameterToString(seed)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Verifies a wallet seed. + * + * @param seed Seed to be verified. + */ + public void walletSeedVerify (String seed, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v2/wallet/seed/verify".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("seed", ApiInvoker.parameterToString(seed)); + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Creates and broadcasts a transaction sending money from one of our wallets to destination address. + * @param id Wallet id + * @param dst Recipient address + * @param coins Number of coins to spend, in droplets. 1 coin equals 1e6 droplets. + * @param password Wallet password. + * @return Object + */ + public Object walletSpent (String id, String dst, String coins, String password) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletSpent", + new ApiException(400, "Missing the required parameter 'id' when calling walletSpent")); + } + // verify the required parameter 'dst' is set + if (dst == null) { + VolleyError error = new VolleyError("Missing the required parameter 'dst' when calling walletSpent", + new ApiException(400, "Missing the required parameter 'dst' when calling walletSpent")); + } + // verify the required parameter 'coins' is set + if (coins == null) { + VolleyError error = new VolleyError("Missing the required parameter 'coins' when calling walletSpent", + new ApiException(400, "Missing the required parameter 'coins' when calling walletSpent")); + } + // verify the required parameter 'password' is set + if (password == null) { + VolleyError error = new VolleyError("Missing the required parameter 'password' when calling walletSpent", + new ApiException(400, "Missing the required parameter 'password' when calling walletSpent")); + } + + // create path and map variables + String path = "/api/v1/wallet/spend"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + headerParams.put("id", ApiInvoker.parameterToString(id)); + headerParams.put("dst", ApiInvoker.parameterToString(dst)); + headerParams.put("coins", ApiInvoker.parameterToString(coins)); + headerParams.put("password", ApiInvoker.parameterToString(password)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Creates and broadcasts a transaction sending money from one of our wallets to destination address. + * @param id Wallet id * @param dst Recipient address * @param coins Number of coins to spend, in droplets. 1 coin equals 1e6 droplets. * @param password Wallet password. + */ + public void walletSpent (String id, String dst, String coins, String password, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletSpent", + new ApiException(400, "Missing the required parameter 'id' when calling walletSpent")); + } + // verify the required parameter 'dst' is set + if (dst == null) { + VolleyError error = new VolleyError("Missing the required parameter 'dst' when calling walletSpent", + new ApiException(400, "Missing the required parameter 'dst' when calling walletSpent")); + } + // verify the required parameter 'coins' is set + if (coins == null) { + VolleyError error = new VolleyError("Missing the required parameter 'coins' when calling walletSpent", + new ApiException(400, "Missing the required parameter 'coins' when calling walletSpent")); + } + // verify the required parameter 'password' is set + if (password == null) { + VolleyError error = new VolleyError("Missing the required parameter 'password' when calling walletSpent", + new ApiException(400, "Missing the required parameter 'password' when calling walletSpent")); + } + + // create path and map variables + String path = "/api/v1/wallet/spend".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("id", ApiInvoker.parameterToString(id)); + headerParams.put("dst", ApiInvoker.parameterToString(dst)); + headerParams.put("coins", ApiInvoker.parameterToString(coins)); + headerParams.put("password", ApiInvoker.parameterToString(password)); + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Creates a signed transaction + * @param inlineObject + * @return Object + */ + public Object walletTransaction (InlineObject inlineObject) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = inlineObject; + + // create path and map variables + String path = "/api/v1/wallet/transaction"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + "application/json", + "application/xml" + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Creates a signed transaction + * @param inlineObject + */ + public void walletTransaction (InlineObject inlineObject, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = inlineObject; + + + // create path and map variables + String path = "/api/v1/wallet/transaction".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + "application/json","application/xml" + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Returns returns all unconfirmed transactions for all addresses in a given wallet verbose + * @param id Wallet id. + * @return Object + */ + public Object walletTransactions (String id) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletTransactions", + new ApiException(400, "Missing the required parameter 'id' when calling walletTransactions")); + } + + // create path and map variables + String path = "/api/v1/wallet/transactions"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Returns returns all unconfirmed transactions for all addresses in a given wallet verbose + * @param id Wallet id. + */ + public void walletTransactions (String id, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletTransactions", + new ApiException(400, "Missing the required parameter 'id' when calling walletTransactions")); + } + + // create path and map variables + String path = "/api/v1/wallet/transactions".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Unloads wallet from the wallet service. + * + * @param id Wallet Id. + * @return void + */ + public void walletUnload (String id) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletUnload", + new ApiException(400, "Missing the required parameter 'id' when calling walletUnload")); + } + + // create path and map variables + String path = "/api/v1/wallet/unload"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Unloads wallet from the wallet service. + * + * @param id Wallet Id. + */ + public void walletUnload (String id, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletUnload", + new ApiException(400, "Missing the required parameter 'id' when calling walletUnload")); + } + + // create path and map variables + String path = "/api/v1/wallet/unload".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + queryParams.addAll(ApiInvoker.parameterToPairs("", "id", id)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * Update the wallet. + * + * @param id Wallet Id. + * @param label The label the wallet will be updated to. + * @return void + */ + public void walletUpdate (String id, String label) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletUpdate", + new ApiException(400, "Missing the required parameter 'id' when calling walletUpdate")); + } + // verify the required parameter 'label' is set + if (label == null) { + VolleyError error = new VolleyError("Missing the required parameter 'label' when calling walletUpdate", + new ApiException(400, "Missing the required parameter 'label' when calling walletUpdate")); + } + + // create path and map variables + String path = "/api/v1/wallet/update"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + headerParams.put("id", ApiInvoker.parameterToString(id)); + headerParams.put("label", ApiInvoker.parameterToString(label)); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return ; + } else { + return ; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * Update the wallet. + * + * @param id Wallet Id. * @param label The label the wallet will be updated to. + */ + public void walletUpdate (String id, String label, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + VolleyError error = new VolleyError("Missing the required parameter 'id' when calling walletUpdate", + new ApiException(400, "Missing the required parameter 'id' when calling walletUpdate")); + } + // verify the required parameter 'label' is set + if (label == null) { + VolleyError error = new VolleyError("Missing the required parameter 'label' when calling walletUpdate", + new ApiException(400, "Missing the required parameter 'label' when calling walletUpdate")); + } + + // create path and map variables + String path = "/api/v1/wallet/update".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + headerParams.put("id", ApiInvoker.parameterToString(id)); + headerParams.put("label", ApiInvoker.parameterToString(label)); + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { "csrfAuth" }; + + try { + apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + responseListener.onResponse(localVarResponse); + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } + /** + * + * Returns all loaded wallets + * @return List + */ + public List wallets () throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = null; + + // create path and map variables + String path = "/api/v1/wallets"; + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + String[] contentTypes = { + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); + if (localVarResponse != null) { + return (List) ApiInvoker.deserialize(localVarResponse, "array", InlineResponse2005.class); + } else { + return null; + } + } catch (ApiException ex) { + throw ex; + } catch (InterruptedException ex) { + throw ex; + } catch (ExecutionException ex) { + if (ex.getCause() instanceof VolleyError) { + VolleyError volleyError = (VolleyError)ex.getCause(); + if (volleyError.networkResponse != null) { + throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage()); + } + } + throw ex; + } catch (TimeoutException ex) { + throw ex; + } + } + + /** + * + * Returns all loaded wallets + + */ + public void wallets (final Response.Listener> responseListener, final Response.ErrorListener errorListener) { + Object postBody = null; + + + // create path and map variables + String path = "/api/v1/wallets".replaceAll("\\{format\\}","json"); + + // query params + List queryParams = new ArrayList(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = localVarBuilder.build(); + postBody = httpEntity; + } else { + // normal form params + } + + String[] authNames = new String[] { }; + + try { + apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, + new Response.Listener() { + @Override + public void onResponse(String localVarResponse) { + try { + responseListener.onResponse((List) ApiInvoker.deserialize(localVarResponse, "array", InlineResponse2005.class)); + } catch (ApiException exception) { + errorListener.onErrorResponse(new VolleyError(exception)); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + errorListener.onErrorResponse(error); + } + }); + } catch (ApiException ex) { + errorListener.onErrorResponse(new VolleyError(ex)); + } + } +} diff --git a/travis/skyapi.sh b/travis/skyapi.sh new file mode 100755 index 0000000..dcc8a63 --- /dev/null +++ b/travis/skyapi.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +cd $TRAVIS_BUILD_DIR/lib/skyapi +mvn test