From be7cbc0261f1b6f647a90ca815562524cef1cb90 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Fri, 15 Mar 2019 10:52:16 -0400 Subject: [PATCH] [skyapi] refs #5 Added Objetive C wrapper for Skycoin Api --- lib/skyapi/.gitignore | 53 + lib/skyapi/.openapi-generator-ignore | 23 + lib/skyapi/.openapi-generator/VERSION | 1 + lib/skyapi/README.md | 196 + .../docs/OAIApiv1exploreraddressInputs.md | 14 + .../docs/OAIApiv1exploreraddressOutputs.md | 13 + .../docs/OAIApiv1exploreraddressStatus.md | 13 + .../docs/OAIApiv1pendingTxsTransaction.md | 17 + lib/skyapi/docs/OAIApiv1walletsEntries.md | 11 + lib/skyapi/docs/OAIApiv1walletsMeta.md | 17 + ...OAIApiv1wallettransactionHoursSelection.md | 12 + .../docs/OAIApiv1wallettransactionTo.md | 12 + .../docs/OAIApiv1wallettransactionWallet.md | 13 + lib/skyapi/docs/OAIDefaultApi.md | 2719 +++++++++++++ lib/skyapi/docs/OAIInlineObject.md | 14 + lib/skyapi/docs/OAIInlineResponse200.md | 18 + lib/skyapi/docs/OAIInlineResponse2001.md | 10 + lib/skyapi/docs/OAIInlineResponse2002.md | 19 + lib/skyapi/docs/OAIInlineResponse2003.md | 22 + ...esponse2003UnconfirmedVerifyTransaction.md | 12 + lib/skyapi/docs/OAIInlineResponse2004.md | 14 + lib/skyapi/docs/OAIInlineResponse2005.md | 11 + lib/skyapi/docs/OAIInlineResponse2006.md | 10 + lib/skyapi/docs/OAIInlineResponse2007.md | 11 + lib/skyapi/docs/OAIInlineResponse2007Data.md | 10 + lib/skyapi/docs/OAIInlineResponseDefault.md | 11 + lib/skyapi/git_push.sh | 52 + lib/skyapi/skyapi.podspec | 37 + lib/skyapi/skyapi/Api/OAIDefaultApi.h | 740 ++++ lib/skyapi/skyapi/Api/OAIDefaultApi.m | 3401 +++++++++++++++++ .../Core/JSONValueTransformer+ISO8601.h | 19 + .../Core/JSONValueTransformer+ISO8601.m | 17 + lib/skyapi/skyapi/Core/OAIApi.h | 29 + lib/skyapi/skyapi/Core/OAIApiClient.h | 121 + lib/skyapi/skyapi/Core/OAIApiClient.m | 376 ++ .../skyapi/Core/OAIBasicAuthTokenProvider.h | 14 + .../skyapi/Core/OAIBasicAuthTokenProvider.m | 19 + lib/skyapi/skyapi/Core/OAIConfiguration.h | 89 + .../skyapi/Core/OAIDefaultConfiguration.h | 171 + .../skyapi/Core/OAIDefaultConfiguration.m | 145 + .../skyapi/Core/OAIJSONRequestSerializer.h | 18 + .../skyapi/Core/OAIJSONRequestSerializer.m | 37 + lib/skyapi/skyapi/Core/OAILogger.h | 61 + lib/skyapi/skyapi/Core/OAILogger.m | 73 + lib/skyapi/skyapi/Core/OAIObject.h | 19 + lib/skyapi/skyapi/Core/OAIObject.m | 42 + .../skyapi/Core/OAIQueryParamCollection.h | 24 + .../skyapi/Core/OAIQueryParamCollection.m | 20 + .../skyapi/Core/OAIResponseDeserializer.h | 57 + .../skyapi/Core/OAIResponseDeserializer.m | 247 ++ lib/skyapi/skyapi/Core/OAISanitizer.h | 63 + lib/skyapi/skyapi/Core/OAISanitizer.m | 170 + .../Model/OAIApiv1exploreraddressInputs.h | 36 + .../Model/OAIApiv1exploreraddressInputs.m | 34 + .../Model/OAIApiv1exploreraddressOutputs.h | 34 + .../Model/OAIApiv1exploreraddressOutputs.m | 34 + .../Model/OAIApiv1exploreraddressStatus.h | 34 + .../Model/OAIApiv1exploreraddressStatus.m | 34 + .../Model/OAIApiv1pendingTxsTransaction.h | 45 + .../Model/OAIApiv1pendingTxsTransaction.m | 34 + .../skyapi/Model/OAIApiv1walletsEntries.h | 30 + .../skyapi/Model/OAIApiv1walletsEntries.m | 34 + lib/skyapi/skyapi/Model/OAIApiv1walletsMeta.h | 42 + lib/skyapi/skyapi/Model/OAIApiv1walletsMeta.m | 34 + .../OAIApiv1wallettransactionHoursSelection.h | 32 + .../OAIApiv1wallettransactionHoursSelection.m | 34 + .../Model/OAIApiv1wallettransactionTo.h | 32 + .../Model/OAIApiv1wallettransactionTo.m | 34 + .../Model/OAIApiv1wallettransactionWallet.h | 34 + .../Model/OAIApiv1wallettransactionWallet.m | 34 + lib/skyapi/skyapi/Model/OAIInlineObject.h | 45 + lib/skyapi/skyapi/Model/OAIInlineObject.m | 34 + .../skyapi/Model/OAIInlineResponse200.h | 44 + .../skyapi/Model/OAIInlineResponse200.m | 34 + .../skyapi/Model/OAIInlineResponse2001.h | 28 + .../skyapi/Model/OAIInlineResponse2001.m | 34 + .../skyapi/Model/OAIInlineResponse2002.h | 55 + .../skyapi/Model/OAIInlineResponse2002.m | 34 + .../skyapi/Model/OAIInlineResponse2003.h | 55 + .../skyapi/Model/OAIInlineResponse2003.m | 34 + ...Response2003UnconfirmedVerifyTransaction.h | 32 + ...Response2003UnconfirmedVerifyTransaction.m | 34 + .../skyapi/Model/OAIInlineResponse2004.h | 39 + .../skyapi/Model/OAIInlineResponse2004.m | 34 + .../skyapi/Model/OAIInlineResponse2005.h | 36 + .../skyapi/Model/OAIInlineResponse2005.m | 34 + .../skyapi/Model/OAIInlineResponse2006.h | 28 + .../skyapi/Model/OAIInlineResponse2006.m | 34 + .../skyapi/Model/OAIInlineResponse2007.h | 33 + .../skyapi/Model/OAIInlineResponse2007.m | 34 + .../skyapi/Model/OAIInlineResponse2007Data.h | 28 + .../skyapi/Model/OAIInlineResponse2007Data.m | 34 + .../skyapi/Model/OAIInlineResponseDefault.h | 30 + .../skyapi/Model/OAIInlineResponseDefault.m | 34 + 94 files changed, 10823 insertions(+) create mode 100644 lib/skyapi/.gitignore create mode 100644 lib/skyapi/.openapi-generator-ignore create mode 100644 lib/skyapi/.openapi-generator/VERSION create mode 100644 lib/skyapi/README.md create mode 100644 lib/skyapi/docs/OAIApiv1exploreraddressInputs.md create mode 100644 lib/skyapi/docs/OAIApiv1exploreraddressOutputs.md create mode 100644 lib/skyapi/docs/OAIApiv1exploreraddressStatus.md create mode 100644 lib/skyapi/docs/OAIApiv1pendingTxsTransaction.md create mode 100644 lib/skyapi/docs/OAIApiv1walletsEntries.md create mode 100644 lib/skyapi/docs/OAIApiv1walletsMeta.md create mode 100644 lib/skyapi/docs/OAIApiv1wallettransactionHoursSelection.md create mode 100644 lib/skyapi/docs/OAIApiv1wallettransactionTo.md create mode 100644 lib/skyapi/docs/OAIApiv1wallettransactionWallet.md create mode 100644 lib/skyapi/docs/OAIDefaultApi.md create mode 100644 lib/skyapi/docs/OAIInlineObject.md create mode 100644 lib/skyapi/docs/OAIInlineResponse200.md create mode 100644 lib/skyapi/docs/OAIInlineResponse2001.md create mode 100644 lib/skyapi/docs/OAIInlineResponse2002.md create mode 100644 lib/skyapi/docs/OAIInlineResponse2003.md create mode 100644 lib/skyapi/docs/OAIInlineResponse2003UnconfirmedVerifyTransaction.md create mode 100644 lib/skyapi/docs/OAIInlineResponse2004.md create mode 100644 lib/skyapi/docs/OAIInlineResponse2005.md create mode 100644 lib/skyapi/docs/OAIInlineResponse2006.md create mode 100644 lib/skyapi/docs/OAIInlineResponse2007.md create mode 100644 lib/skyapi/docs/OAIInlineResponse2007Data.md create mode 100644 lib/skyapi/docs/OAIInlineResponseDefault.md create mode 100644 lib/skyapi/git_push.sh create mode 100644 lib/skyapi/skyapi.podspec create mode 100644 lib/skyapi/skyapi/Api/OAIDefaultApi.h create mode 100644 lib/skyapi/skyapi/Api/OAIDefaultApi.m create mode 100644 lib/skyapi/skyapi/Core/JSONValueTransformer+ISO8601.h create mode 100644 lib/skyapi/skyapi/Core/JSONValueTransformer+ISO8601.m create mode 100644 lib/skyapi/skyapi/Core/OAIApi.h create mode 100644 lib/skyapi/skyapi/Core/OAIApiClient.h create mode 100644 lib/skyapi/skyapi/Core/OAIApiClient.m create mode 100644 lib/skyapi/skyapi/Core/OAIBasicAuthTokenProvider.h create mode 100644 lib/skyapi/skyapi/Core/OAIBasicAuthTokenProvider.m create mode 100644 lib/skyapi/skyapi/Core/OAIConfiguration.h create mode 100644 lib/skyapi/skyapi/Core/OAIDefaultConfiguration.h create mode 100644 lib/skyapi/skyapi/Core/OAIDefaultConfiguration.m create mode 100644 lib/skyapi/skyapi/Core/OAIJSONRequestSerializer.h create mode 100644 lib/skyapi/skyapi/Core/OAIJSONRequestSerializer.m create mode 100644 lib/skyapi/skyapi/Core/OAILogger.h create mode 100644 lib/skyapi/skyapi/Core/OAILogger.m create mode 100644 lib/skyapi/skyapi/Core/OAIObject.h create mode 100644 lib/skyapi/skyapi/Core/OAIObject.m create mode 100644 lib/skyapi/skyapi/Core/OAIQueryParamCollection.h create mode 100644 lib/skyapi/skyapi/Core/OAIQueryParamCollection.m create mode 100644 lib/skyapi/skyapi/Core/OAIResponseDeserializer.h create mode 100644 lib/skyapi/skyapi/Core/OAIResponseDeserializer.m create mode 100644 lib/skyapi/skyapi/Core/OAISanitizer.h create mode 100644 lib/skyapi/skyapi/Core/OAISanitizer.m create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1exploreraddressInputs.h create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1exploreraddressInputs.m create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1exploreraddressOutputs.h create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1exploreraddressOutputs.m create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1exploreraddressStatus.h create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1exploreraddressStatus.m create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1pendingTxsTransaction.h create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1pendingTxsTransaction.m create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1walletsEntries.h create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1walletsEntries.m create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1walletsMeta.h create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1walletsMeta.m create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1wallettransactionHoursSelection.h create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1wallettransactionHoursSelection.m create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1wallettransactionTo.h create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1wallettransactionTo.m create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1wallettransactionWallet.h create mode 100644 lib/skyapi/skyapi/Model/OAIApiv1wallettransactionWallet.m create mode 100644 lib/skyapi/skyapi/Model/OAIInlineObject.h create mode 100644 lib/skyapi/skyapi/Model/OAIInlineObject.m create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse200.h create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse200.m create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2001.h create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2001.m create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2002.h create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2002.m create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2003.h create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2003.m create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2003UnconfirmedVerifyTransaction.h create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2003UnconfirmedVerifyTransaction.m create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2004.h create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2004.m create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2005.h create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2005.m create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2006.h create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2006.m create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2007.h create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2007.m create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2007Data.h create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponse2007Data.m create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponseDefault.h create mode 100644 lib/skyapi/skyapi/Model/OAIInlineResponseDefault.m diff --git a/lib/skyapi/.gitignore b/lib/skyapi/.gitignore new file mode 100644 index 0000000..79d9331 --- /dev/null +++ b/lib/skyapi/.gitignore @@ -0,0 +1,53 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata + +## Other +*.xccheckout +*.moved-aside +*.xcuserstate +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md + +fastlane/report.xml +fastlane/screenshots 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..06d0b8c --- /dev/null +++ b/lib/skyapi/README.md @@ -0,0 +1,196 @@ +# skyapi + +Skycoin is a next-generation cryptocurrency. + +This ObjC package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.25.1 +- Package version: +- Build package: org.openapitools.codegen.languages.ObjcClientCodegen +For more information, please visit [http://127.0.0.1:6420](http://127.0.0.1:6420) + +## Requirements + +The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.com/questions/7778356/how-to-enable-disable-automatic-reference-counting) to be enabled in the Xcode project. + +## Installation & Usage +### Install from Github using [CocoaPods](https://cocoapods.org/) + +Add the following to the Podfile: + +```ruby +pod 'skyapi', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' +``` + +To specify a particular branch, append `, :branch => 'branch-name-here'` + +To specify a particular commit, append `, :commit => '11aa22'` + +### Install from local path using [CocoaPods](https://cocoapods.org/) + +Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/skyapi) and then add the following to the Podfile: + +```ruby +pod 'skyapi', :path => 'Vendor/skyapi' +``` + +### Usage + +Import the following: + +```objc +#import +#import +// load models +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +// load API classes for accessing endpoints +#import + +``` + +## Recommendation + +It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issues. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```objc + + + +OAIDefaultApi *apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns the total number of unique address that have coins. +[apiInstance addressCountWithCompletionHandler: + ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error: %@", error); + } + }]; + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://127.0.0.1:6420* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*OAIDefaultApi* | [**addressCount**](docs/OAIDefaultApi.md#addresscount) | **GET** /api/v1/addresscount | Returns the total number of unique address that have coins. +*OAIDefaultApi* | [**addressUxouts**](docs/OAIDefaultApi.md#addressuxouts) | **GET** /api/v1/address_uxouts | +*OAIDefaultApi* | [**balanceGet**](docs/OAIDefaultApi.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. +*OAIDefaultApi* | [**balancePost**](docs/OAIDefaultApi.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. +*OAIDefaultApi* | [**block**](docs/OAIDefaultApi.md#block) | **GET** /api/v1/block | +*OAIDefaultApi* | [**blockchainMetadata**](docs/OAIDefaultApi.md#blockchainmetadata) | **GET** /api/v1/blockchain/metadata | Returns the blockchain metadata. +*OAIDefaultApi* | [**blockchainProgress**](docs/OAIDefaultApi.md#blockchainprogress) | **GET** /api/v1/blockchain/progress | Returns the blockchain sync progress. +*OAIDefaultApi* | [**blocksGet**](docs/OAIDefaultApi.md#blocksget) | **GET** /api/v1/blocks | blocksHandler returns blocks between a start and end point, +*OAIDefaultApi* | [**blocksPost**](docs/OAIDefaultApi.md#blockspost) | **POST** /api/v1/blocks | blocksHandler returns blocks between a start and end point, +*OAIDefaultApi* | [**coinSupply**](docs/OAIDefaultApi.md#coinsupply) | **GET** /api/v1/coinSupply | +*OAIDefaultApi* | [**csrf**](docs/OAIDefaultApi.md#csrf) | **GET** /api/v1/csrf | Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. +*OAIDefaultApi* | [**defaultConnections**](docs/OAIDefaultApi.md#defaultconnections) | **GET** /api/v1/network/defaultConnections | defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. +*OAIDefaultApi* | [**explorerAddress**](docs/OAIDefaultApi.md#exploreraddress) | **GET** /api/v1/explorer/address | +*OAIDefaultApi* | [**health**](docs/OAIDefaultApi.md#health) | **GET** /api/v1/health | Returns node health data. +*OAIDefaultApi* | [**lastBlocks**](docs/OAIDefaultApi.md#lastblocks) | **GET** /api/v1/last_blocks | +*OAIDefaultApi* | [**networkConnection**](docs/OAIDefaultApi.md#networkconnection) | **GET** /api/v1/network/connection | This endpoint returns a specific connection. +*OAIDefaultApi* | [**networkConnections**](docs/OAIDefaultApi.md#networkconnections) | **GET** /api/v1/network/connections | This endpoint returns all outgoings connections. +*OAIDefaultApi* | [**networkConnectionsDisconnect**](docs/OAIDefaultApi.md#networkconnectionsdisconnect) | **POST** /api/v1/network/connection/disconnect | +*OAIDefaultApi* | [**networkConnectionsExchange**](docs/OAIDefaultApi.md#networkconnectionsexchange) | **GET** /api/v1/network/connections/exchange | +*OAIDefaultApi* | [**networkConnectionsTrust**](docs/OAIDefaultApi.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. +*OAIDefaultApi* | [**outputsGet**](docs/OAIDefaultApi.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. +*OAIDefaultApi* | [**outputsPost**](docs/OAIDefaultApi.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. +*OAIDefaultApi* | [**pendingTxs**](docs/OAIDefaultApi.md#pendingtxs) | **GET** /api/v1/pendingTxs | +*OAIDefaultApi* | [**resendUnconfirmedTxns**](docs/OAIDefaultApi.md#resendunconfirmedtxns) | **POST** /api/v1/resendUnconfirmedTxns | +*OAIDefaultApi* | [**richlist**](docs/OAIDefaultApi.md#richlist) | **GET** /api/v1/richlist | Returns the top skycoin holders. +*OAIDefaultApi* | [**transaction**](docs/OAIDefaultApi.md#transaction) | **GET** /api/v1/transaction | +*OAIDefaultApi* | [**transactionInject**](docs/OAIDefaultApi.md#transactioninject) | **POST** /api/v2/transaction/inject | Broadcast a hex-encoded, serialized transaction to the network. +*OAIDefaultApi* | [**transactionRaw**](docs/OAIDefaultApi.md#transactionraw) | **GET** /api/v2/transaction/raw | Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. +*OAIDefaultApi* | [**transactionVerify**](docs/OAIDefaultApi.md#transactionverify) | **POST** /api/v2/transaction/verify | +*OAIDefaultApi* | [**transactionsGet**](docs/OAIDefaultApi.md#transactionsget) | **GET** /api/v1/transactions | Returns transactions that match the filters. +*OAIDefaultApi* | [**transactionsPost**](docs/OAIDefaultApi.md#transactionspost) | **POST** /api/v1/transactions | Returns transactions that match the filters. +*OAIDefaultApi* | [**uxout**](docs/OAIDefaultApi.md#uxout) | **GET** /api/v1/uxout | Returns an unspent output by ID. +*OAIDefaultApi* | [**verifyAddress**](docs/OAIDefaultApi.md#verifyaddress) | **POST** /api/v2/address/verify | Verifies a Skycoin address. +*OAIDefaultApi* | [**version**](docs/OAIDefaultApi.md#version) | **GET** /api/v1/version | +*OAIDefaultApi* | [**wallet**](docs/OAIDefaultApi.md#wallet) | **GET** /api/v1/wallet | Returns a wallet by id. +*OAIDefaultApi* | [**walletBalance**](docs/OAIDefaultApi.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. +*OAIDefaultApi* | [**walletCreate**](docs/OAIDefaultApi.md#walletcreate) | **POST** /api/v1/wallet/create | +*OAIDefaultApi* | [**walletDecrypt**](docs/OAIDefaultApi.md#walletdecrypt) | **POST** /api/v1/wallet/decrypt | Decrypts wallet. +*OAIDefaultApi* | [**walletEncrypt**](docs/OAIDefaultApi.md#walletencrypt) | **POST** /api/v1/wallet/encrypt | Encrypt wallet. +*OAIDefaultApi* | [**walletFolder**](docs/OAIDefaultApi.md#walletfolder) | **GET** /api/v1/wallets/folderName | +*OAIDefaultApi* | [**walletNewAddress**](docs/OAIDefaultApi.md#walletnewaddress) | **POST** /api/v1/wallet/newAddress | +*OAIDefaultApi* | [**walletNewSeed**](docs/OAIDefaultApi.md#walletnewseed) | **GET** /api/v1/wallet/newSeed | +*OAIDefaultApi* | [**walletRecover**](docs/OAIDefaultApi.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. +*OAIDefaultApi* | [**walletSeed**](docs/OAIDefaultApi.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. +*OAIDefaultApi* | [**walletSeedVerify**](docs/OAIDefaultApi.md#walletseedverify) | **POST** /api/v2/wallet/seed/verify | Verifies a wallet seed. +*OAIDefaultApi* | [**walletSpent**](docs/OAIDefaultApi.md#walletspent) | **POST** /api/v1/wallet/spend | +*OAIDefaultApi* | [**walletTransaction**](docs/OAIDefaultApi.md#wallettransaction) | **POST** /api/v1/wallet/transaction | +*OAIDefaultApi* | [**walletTransactions**](docs/OAIDefaultApi.md#wallettransactions) | **GET** /api/v1/wallet/transactions | +*OAIDefaultApi* | [**walletUnload**](docs/OAIDefaultApi.md#walletunload) | **POST** /api/v1/wallet/unload | Unloads wallet from the wallet service. +*OAIDefaultApi* | [**walletUpdate**](docs/OAIDefaultApi.md#walletupdate) | **POST** /api/v1/wallet/update | Update the wallet. +*OAIDefaultApi* | [**wallets**](docs/OAIDefaultApi.md#wallets) | **GET** /api/v1/wallets | + + +## Documentation For Models + + - [OAIApiv1exploreraddressInputs](docs/OAIApiv1exploreraddressInputs.md) + - [OAIApiv1exploreraddressOutputs](docs/OAIApiv1exploreraddressOutputs.md) + - [OAIApiv1exploreraddressStatus](docs/OAIApiv1exploreraddressStatus.md) + - [OAIApiv1pendingTxsTransaction](docs/OAIApiv1pendingTxsTransaction.md) + - [OAIApiv1walletsEntries](docs/OAIApiv1walletsEntries.md) + - [OAIApiv1walletsMeta](docs/OAIApiv1walletsMeta.md) + - [OAIApiv1wallettransactionHoursSelection](docs/OAIApiv1wallettransactionHoursSelection.md) + - [OAIApiv1wallettransactionTo](docs/OAIApiv1wallettransactionTo.md) + - [OAIApiv1wallettransactionWallet](docs/OAIApiv1wallettransactionWallet.md) + - [OAIInlineObject](docs/OAIInlineObject.md) + - [OAIInlineResponse200](docs/OAIInlineResponse200.md) + - [OAIInlineResponse2001](docs/OAIInlineResponse2001.md) + - [OAIInlineResponse2002](docs/OAIInlineResponse2002.md) + - [OAIInlineResponse2003](docs/OAIInlineResponse2003.md) + - [OAIInlineResponse2003UnconfirmedVerifyTransaction](docs/OAIInlineResponse2003UnconfirmedVerifyTransaction.md) + - [OAIInlineResponse2004](docs/OAIInlineResponse2004.md) + - [OAIInlineResponse2005](docs/OAIInlineResponse2005.md) + - [OAIInlineResponse2006](docs/OAIInlineResponse2006.md) + - [OAIInlineResponse2007](docs/OAIInlineResponse2007.md) + - [OAIInlineResponse2007Data](docs/OAIInlineResponse2007Data.md) + - [OAIInlineResponseDefault](docs/OAIInlineResponseDefault.md) + + +## Documentation For Authorization + + +## csrfAuth + +- **Type**: API key +- **API key parameter name**: X-CSRF-TOKEN +- **Location**: HTTP header + + +## Author + +skycoin.doe@example.com + + diff --git a/lib/skyapi/docs/OAIApiv1exploreraddressInputs.md b/lib/skyapi/docs/OAIApiv1exploreraddressInputs.md new file mode 100644 index 0000000..e855d60 --- /dev/null +++ b/lib/skyapi/docs/OAIApiv1exploreraddressInputs.md @@ -0,0 +1,14 @@ +# OAIApiv1exploreraddressInputs + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**owner** | **NSString*** | | [optional] +**hours** | **NSNumber*** | | [optional] +**calculatedHours** | **NSNumber*** | | [optional] +**coins** | **NSString*** | | [optional] +**uxid** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIApiv1exploreraddressOutputs.md b/lib/skyapi/docs/OAIApiv1exploreraddressOutputs.md new file mode 100644 index 0000000..3ea82fb --- /dev/null +++ b/lib/skyapi/docs/OAIApiv1exploreraddressOutputs.md @@ -0,0 +1,13 @@ +# OAIApiv1exploreraddressOutputs + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hours** | **NSNumber*** | | [optional] +**dst** | **NSString*** | | [optional] +**coins** | **NSString*** | | [optional] +**uxid** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIApiv1exploreraddressStatus.md b/lib/skyapi/docs/OAIApiv1exploreraddressStatus.md new file mode 100644 index 0000000..5d23eb1 --- /dev/null +++ b/lib/skyapi/docs/OAIApiv1exploreraddressStatus.md @@ -0,0 +1,13 @@ +# OAIApiv1exploreraddressStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**unconfirmed** | **NSNumber*** | | [optional] +**blockSeq** | **NSNumber*** | | [optional] +**label** | **NSNumber*** | | [optional] +**confirmed** | **NSNumber*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIApiv1pendingTxsTransaction.md b/lib/skyapi/docs/OAIApiv1pendingTxsTransaction.md new file mode 100644 index 0000000..90ec593 --- /dev/null +++ b/lib/skyapi/docs/OAIApiv1pendingTxsTransaction.md @@ -0,0 +1,17 @@ +# OAIApiv1pendingTxsTransaction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**outputs** | [**NSArray<OAIApiv1exploreraddressOutputs>***](OAIApiv1exploreraddressOutputs.md) | | [optional] +**innerHash** | **NSString*** | | [optional] +**inputs** | **NSArray<NSString*>*** | | [optional] +**sigs** | **NSArray<NSString*>*** | | [optional] +**length** | **NSNumber*** | | [optional] +**txid** | **NSString*** | | [optional] +**type** | **NSNumber*** | | [optional] +**timestamp** | **NSNumber*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIApiv1walletsEntries.md b/lib/skyapi/docs/OAIApiv1walletsEntries.md new file mode 100644 index 0000000..850c783 --- /dev/null +++ b/lib/skyapi/docs/OAIApiv1walletsEntries.md @@ -0,0 +1,11 @@ +# OAIApiv1walletsEntries + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**publicKey** | **NSString*** | | [optional] +**address** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIApiv1walletsMeta.md b/lib/skyapi/docs/OAIApiv1walletsMeta.md new file mode 100644 index 0000000..28a1b02 --- /dev/null +++ b/lib/skyapi/docs/OAIApiv1walletsMeta.md @@ -0,0 +1,17 @@ +# OAIApiv1walletsMeta + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filename** | **NSString*** | | [optional] +**encrypted** | **NSNumber*** | | [optional] +**cryptoType** | **NSString*** | | [optional] +**label** | **NSString*** | | [optional] +**type** | **NSString*** | | [optional] +**version** | **NSString*** | | [optional] +**coin** | **NSString*** | | [optional] +**timestamp** | **NSNumber*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIApiv1wallettransactionHoursSelection.md b/lib/skyapi/docs/OAIApiv1wallettransactionHoursSelection.md new file mode 100644 index 0000000..1849424 --- /dev/null +++ b/lib/skyapi/docs/OAIApiv1wallettransactionHoursSelection.md @@ -0,0 +1,12 @@ +# OAIApiv1wallettransactionHoursSelection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **NSString*** | | [optional] +**shareFactor** | **NSString*** | | [optional] +**type** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIApiv1wallettransactionTo.md b/lib/skyapi/docs/OAIApiv1wallettransactionTo.md new file mode 100644 index 0000000..0009c64 --- /dev/null +++ b/lib/skyapi/docs/OAIApiv1wallettransactionTo.md @@ -0,0 +1,12 @@ +# OAIApiv1wallettransactionTo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hours** | **NSNumber*** | | [optional] +**address** | **NSString*** | | [optional] +**coins** | **NSNumber*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIApiv1wallettransactionWallet.md b/lib/skyapi/docs/OAIApiv1wallettransactionWallet.md new file mode 100644 index 0000000..77ab533 --- /dev/null +++ b/lib/skyapi/docs/OAIApiv1wallettransactionWallet.md @@ -0,0 +1,13 @@ +# OAIApiv1wallettransactionWallet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**unspents** | **NSArray<NSString*>*** | | [optional] +**addresses** | **NSArray<NSString*>*** | | [optional] +**password** | **NSString*** | | [optional] +**_id** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIDefaultApi.md b/lib/skyapi/docs/OAIDefaultApi.md new file mode 100644 index 0000000..3350db0 --- /dev/null +++ b/lib/skyapi/docs/OAIDefaultApi.md @@ -0,0 +1,2719 @@ +# OAIDefaultApi + +All URIs are relative to *http://127.0.0.1:6420* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addressCount**](OAIDefaultApi.md#addresscount) | **GET** /api/v1/addresscount | Returns the total number of unique address that have coins. +[**addressUxouts**](OAIDefaultApi.md#addressuxouts) | **GET** /api/v1/address_uxouts | +[**balanceGet**](OAIDefaultApi.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**](OAIDefaultApi.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**](OAIDefaultApi.md#block) | **GET** /api/v1/block | +[**blockchainMetadata**](OAIDefaultApi.md#blockchainmetadata) | **GET** /api/v1/blockchain/metadata | Returns the blockchain metadata. +[**blockchainProgress**](OAIDefaultApi.md#blockchainprogress) | **GET** /api/v1/blockchain/progress | Returns the blockchain sync progress. +[**blocksGet**](OAIDefaultApi.md#blocksget) | **GET** /api/v1/blocks | blocksHandler returns blocks between a start and end point, +[**blocksPost**](OAIDefaultApi.md#blockspost) | **POST** /api/v1/blocks | blocksHandler returns blocks between a start and end point, +[**coinSupply**](OAIDefaultApi.md#coinsupply) | **GET** /api/v1/coinSupply | +[**csrf**](OAIDefaultApi.md#csrf) | **GET** /api/v1/csrf | Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. +[**defaultConnections**](OAIDefaultApi.md#defaultconnections) | **GET** /api/v1/network/defaultConnections | defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. +[**explorerAddress**](OAIDefaultApi.md#exploreraddress) | **GET** /api/v1/explorer/address | +[**health**](OAIDefaultApi.md#health) | **GET** /api/v1/health | Returns node health data. +[**lastBlocks**](OAIDefaultApi.md#lastblocks) | **GET** /api/v1/last_blocks | +[**networkConnection**](OAIDefaultApi.md#networkconnection) | **GET** /api/v1/network/connection | This endpoint returns a specific connection. +[**networkConnections**](OAIDefaultApi.md#networkconnections) | **GET** /api/v1/network/connections | This endpoint returns all outgoings connections. +[**networkConnectionsDisconnect**](OAIDefaultApi.md#networkconnectionsdisconnect) | **POST** /api/v1/network/connection/disconnect | +[**networkConnectionsExchange**](OAIDefaultApi.md#networkconnectionsexchange) | **GET** /api/v1/network/connections/exchange | +[**networkConnectionsTrust**](OAIDefaultApi.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**](OAIDefaultApi.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**](OAIDefaultApi.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**](OAIDefaultApi.md#pendingtxs) | **GET** /api/v1/pendingTxs | +[**resendUnconfirmedTxns**](OAIDefaultApi.md#resendunconfirmedtxns) | **POST** /api/v1/resendUnconfirmedTxns | +[**richlist**](OAIDefaultApi.md#richlist) | **GET** /api/v1/richlist | Returns the top skycoin holders. +[**transaction**](OAIDefaultApi.md#transaction) | **GET** /api/v1/transaction | +[**transactionInject**](OAIDefaultApi.md#transactioninject) | **POST** /api/v2/transaction/inject | Broadcast a hex-encoded, serialized transaction to the network. +[**transactionRaw**](OAIDefaultApi.md#transactionraw) | **GET** /api/v2/transaction/raw | Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. +[**transactionVerify**](OAIDefaultApi.md#transactionverify) | **POST** /api/v2/transaction/verify | +[**transactionsGet**](OAIDefaultApi.md#transactionsget) | **GET** /api/v1/transactions | Returns transactions that match the filters. +[**transactionsPost**](OAIDefaultApi.md#transactionspost) | **POST** /api/v1/transactions | Returns transactions that match the filters. +[**uxout**](OAIDefaultApi.md#uxout) | **GET** /api/v1/uxout | Returns an unspent output by ID. +[**verifyAddress**](OAIDefaultApi.md#verifyaddress) | **POST** /api/v2/address/verify | Verifies a Skycoin address. +[**version**](OAIDefaultApi.md#version) | **GET** /api/v1/version | +[**wallet**](OAIDefaultApi.md#wallet) | **GET** /api/v1/wallet | Returns a wallet by id. +[**walletBalance**](OAIDefaultApi.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**](OAIDefaultApi.md#walletcreate) | **POST** /api/v1/wallet/create | +[**walletDecrypt**](OAIDefaultApi.md#walletdecrypt) | **POST** /api/v1/wallet/decrypt | Decrypts wallet. +[**walletEncrypt**](OAIDefaultApi.md#walletencrypt) | **POST** /api/v1/wallet/encrypt | Encrypt wallet. +[**walletFolder**](OAIDefaultApi.md#walletfolder) | **GET** /api/v1/wallets/folderName | +[**walletNewAddress**](OAIDefaultApi.md#walletnewaddress) | **POST** /api/v1/wallet/newAddress | +[**walletNewSeed**](OAIDefaultApi.md#walletnewseed) | **GET** /api/v1/wallet/newSeed | +[**walletRecover**](OAIDefaultApi.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**](OAIDefaultApi.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**](OAIDefaultApi.md#walletseedverify) | **POST** /api/v2/wallet/seed/verify | Verifies a wallet seed. +[**walletSpent**](OAIDefaultApi.md#walletspent) | **POST** /api/v1/wallet/spend | +[**walletTransaction**](OAIDefaultApi.md#wallettransaction) | **POST** /api/v1/wallet/transaction | +[**walletTransactions**](OAIDefaultApi.md#wallettransactions) | **GET** /api/v1/wallet/transactions | +[**walletUnload**](OAIDefaultApi.md#walletunload) | **POST** /api/v1/wallet/unload | Unloads wallet from the wallet service. +[**walletUpdate**](OAIDefaultApi.md#walletupdate) | **POST** /api/v1/wallet/update | Update the wallet. +[**wallets**](OAIDefaultApi.md#wallets) | **GET** /api/v1/wallets | + + +# **addressCount** +```objc +-(NSURLSessionTask*) addressCountWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns the total number of unique address that have coins. + +### Example +```objc + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns the total number of unique address that have coins. +[apiInstance addressCountWithCompletionHandler: + ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->addressCount: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **addressUxouts** +```objc +-(NSURLSessionTask*) addressUxoutsWithAddress: (NSString*) address + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; +``` + + + +Returns the historical, spent outputs associated with an address + +### Example +```objc + +NSString* address = @"address_example"; // address to filter by + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance addressUxoutsWithAddress:address + completionHandler: ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->addressUxouts: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **address** | **NSString***| address to filter by | + +### Return type + +[**NSArray***](OAIInlineResponse200.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **balanceGet** +```objc +-(NSURLSessionTask*) balanceGetWithAddrs: (NSString*) addrs + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + +### Example +```objc + +NSString* addrs = @"addrs_example"; // command separated list of addresses + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. +[apiInstance balanceGetWithAddrs:addrs + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->balanceGet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addrs** | **NSString***| command separated list of addresses | + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **balancePost** +```objc +-(NSURLSessionTask*) balancePostWithAddrs: (NSString*) addrs + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* addrs = @"addrs_example"; // command separated list of addresses + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. +[apiInstance balancePostWithAddrs:addrs + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->balancePost: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addrs** | **NSString***| command separated list of addresses | + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **block** +```objc +-(NSURLSessionTask*) blockWithHash: (NSString*) hash + seq: (NSNumber*) seq + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + + + +Returns a block by hash or seq. Note: only one of hash or seq is allowed + +### Example +```objc + +NSString* hash = @"hash_example"; // (optional) +NSNumber* seq = @56; // (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance blockWithHash:hash + seq:seq + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->block: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **hash** | **NSString***| | [optional] + **seq** | **NSNumber***| | [optional] + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **blockchainMetadata** +```objc +-(NSURLSessionTask*) blockchainMetadataWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns the blockchain metadata. + +### Example +```objc + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns the blockchain metadata. +[apiInstance blockchainMetadataWithCompletionHandler: + ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->blockchainMetadata: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **blockchainProgress** +```objc +-(NSURLSessionTask*) blockchainProgressWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns the blockchain sync progress. + +### Example +```objc + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns the blockchain sync progress. +[apiInstance blockchainProgressWithCompletionHandler: + ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->blockchainProgress: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **blocksGet** +```objc +-(NSURLSessionTask*) blocksGetWithStart: (NSNumber*) start + end: (NSNumber*) end + seqs: (NSArray*) seqs + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +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 +```objc + +NSNumber* start = @56; // (optional) +NSNumber* end = @56; // (optional) +NSArray* seqs = @[@56]; // (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// blocksHandler returns blocks between a start and end point, +[apiInstance blocksGetWithStart:start + end:end + seqs:seqs + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->blocksGet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start** | **NSNumber***| | [optional] + **end** | **NSNumber***| | [optional] + **seqs** | [**NSArray<NSNumber*>***](NSNumber*.md)| | [optional] + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **blocksPost** +```objc +-(NSURLSessionTask*) blocksPostWithStart: (NSNumber*) start + end: (NSNumber*) end + seqs: (NSArray*) seqs + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +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 +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSNumber* start = @56; // (optional) +NSNumber* end = @56; // (optional) +NSArray* seqs = @[@56]; // (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// blocksHandler returns blocks between a start and end point, +[apiInstance blocksPostWithStart:start + end:end + seqs:seqs + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->blocksPost: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start** | **NSNumber***| | [optional] + **end** | **NSNumber***| | [optional] + **seqs** | [**NSArray<NSNumber*>***](NSNumber*.md)| | [optional] + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **coinSupply** +```objc +-(NSURLSessionTask*) coinSupplyWithCompletionHandler: + (void (^)(NSError* error)) handler; +``` + + + +coinSupplyHandler returns coin distribution supply stats + +### Example +```objc + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance coinSupplyWithCompletionHandler: + ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIDefaultApi->coinSupply: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **csrf** +```objc +-(NSURLSessionTask*) csrfWithCompletionHandler: + (void (^)(OAIInlineResponse2001* output, NSError* error)) handler; +``` + +Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. + +### Example +```objc + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. +[apiInstance csrfWithCompletionHandler: + ^(OAIInlineResponse2001* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->csrf: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**OAIInlineResponse2001***](OAIInlineResponse2001.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **defaultConnections** +```objc +-(NSURLSessionTask*) defaultConnectionsWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler; +``` + +defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. + +### Example +```objc + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. +[apiInstance defaultConnectionsWithCompletionHandler: + ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->defaultConnections: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**NSArray*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **explorerAddress** +```objc +-(NSURLSessionTask*) explorerAddressWithAddress: (NSString*) address + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; +``` + + + +Returns all transactions (confirmed and unconfirmed) for an address + +### Example +```objc + +NSString* address = @"address_example"; // tags to filter by (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance explorerAddressWithAddress:address + completionHandler: ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->explorerAddress: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **address** | **NSString***| tags to filter by | [optional] + +### Return type + +[**NSArray***](OAIInlineResponse2002.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **health** +```objc +-(NSURLSessionTask*) healthWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns node health data. + +### Example +```objc + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns node health data. +[apiInstance healthWithCompletionHandler: + ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->health: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **lastBlocks** +```objc +-(NSURLSessionTask*) lastBlocksWithNum: (NSNumber*) num + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + + + +Returns the most recent N blocks on the blockchain + +### Example +```objc + +NSNumber* num = @56; // + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance lastBlocksWithNum:num + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->lastBlocks: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **num** | **NSNumber***| | + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **networkConnection** +```objc +-(NSURLSessionTask*) networkConnectionWithAddr: (NSString*) addr + completionHandler: (void (^)(OAIInlineResponse2003* output, NSError* error)) handler; +``` + +This endpoint returns a specific connection. + +### Example +```objc + +NSString* addr = @"addr_example"; // Address port + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// This endpoint returns a specific connection. +[apiInstance networkConnectionWithAddr:addr + completionHandler: ^(OAIInlineResponse2003* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->networkConnection: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addr** | **NSString***| Address port | + +### Return type + +[**OAIInlineResponse2003***](OAIInlineResponse2003.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **networkConnections** +```objc +-(NSURLSessionTask*) networkConnectionsWithStates: (NSString*) states + direction: (NSString*) direction + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; +``` + +This endpoint returns all outgoings connections. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* states = @"states_example"; // Connection status. (optional) +NSString* direction = @"direction_example"; // Direction of the connection. (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// This endpoint returns all outgoings connections. +[apiInstance networkConnectionsWithStates:states + direction:direction + completionHandler: ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->networkConnections: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **states** | **NSString***| Connection status. | [optional] + **direction** | **NSString***| Direction of the connection. | [optional] + +### Return type + +[**NSArray***](OAIInlineResponse2003.md) + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **networkConnectionsDisconnect** +```objc +-(NSURLSessionTask*) networkConnectionsDisconnectWithId: (NSString*) _id + completionHandler: (void (^)(NSError* error)) handler; +``` + + + +This endpoint disconnects a connection by ID or address + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* _id = @"_id_example"; // Address id. + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance networkConnectionsDisconnectWithId:_id + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIDefaultApi->networkConnectionsDisconnect: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | **NSString***| Address id. | + +### Return type + +void (empty response body) + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **networkConnectionsExchange** +```objc +-(NSURLSessionTask*) networkConnectionsExchangeWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler; +``` + + + +This endpoint returns all connections found through peer exchange + +### Example +```objc + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance networkConnectionsExchangeWithCompletionHandler: + ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->networkConnectionsExchange: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**NSArray*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **networkConnectionsTrust** +```objc +-(NSURLSessionTask*) networkConnectionsTrustWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler; +``` + +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 +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// 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. +[apiInstance networkConnectionsTrustWithCompletionHandler: + ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->networkConnectionsTrust: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**NSArray*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **outputsGet** +```objc +-(NSURLSessionTask*) outputsGetWithAddress: (NSArray*) address + hash: (NSArray*) hash + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +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 +```objc + +NSArray* address = @[@"address_example"]; // (optional) +NSArray* hash = @[@"hash_example"]; // (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// 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. +[apiInstance outputsGetWithAddress:address + hash:hash + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->outputsGet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **address** | [**NSArray<NSString*>***](NSString*.md)| | [optional] + **hash** | [**NSArray<NSString*>***](NSString*.md)| | [optional] + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **outputsPost** +```objc +-(NSURLSessionTask*) outputsPostWithAddress: (NSString*) address + hash: (NSString*) hash + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +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 +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* address = @"address_example"; // (optional) +NSString* hash = @"hash_example"; // (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// 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. +[apiInstance outputsPostWithAddress:address + hash:hash + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->outputsPost: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **address** | **NSString***| | [optional] + **hash** | **NSString***| | [optional] + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pendingTxs** +```objc +-(NSURLSessionTask*) pendingTxsWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler; +``` + + + +Returns pending (unconfirmed) transactions without verbose + +### Example +```objc + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance pendingTxsWithCompletionHandler: + ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->pendingTxs: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**NSArray***](OAIInlineResponse2004.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **resendUnconfirmedTxns** +```objc +-(NSURLSessionTask*) resendUnconfirmedTxnsWithCompletionHandler: + (void (^)(NSError* error)) handler; +``` + + + +Broadcasts all unconfirmed transactions from the unconfirmed transaction pool + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance resendUnconfirmedTxnsWithCompletionHandler: + ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIDefaultApi->resendUnconfirmedTxns: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **richlist** +```objc +-(NSURLSessionTask*) richlistWithIncludeDistribution: (NSNumber*) includeDistribution + n: (NSString*) n + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns the top skycoin holders. + +### Example +```objc + +NSNumber* includeDistribution = @56; // include distribution addresses or not, default value false (optional) +NSString* n = @"n_example"; // include distribution addresses or not, default value false (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns the top skycoin holders. +[apiInstance richlistWithIncludeDistribution:includeDistribution + n:n + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->richlist: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **includeDistribution** | **NSNumber***| include distribution addresses or not, default value false | [optional] + **n** | **NSString***| include distribution addresses or not, default value false | [optional] + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **transaction** +```objc +-(NSURLSessionTask*) transactionWithTxid: (NSString*) txid + encoded: (NSNumber*) encoded + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + + + +Returns a transaction identified by its txid hash with just id + +### Example +```objc + +NSString* txid = @"txid_example"; // transaction hash +NSNumber* encoded = @56; // return as a raw encoded transaction. (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance transactionWithTxid:txid + encoded:encoded + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->transaction: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **txid** | **NSString***| transaction hash | + **encoded** | **NSNumber***| return as a raw encoded transaction. | [optional] + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **transactionInject** +```objc +-(NSURLSessionTask*) transactionInjectWithRawtx: (NSString*) rawtx + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Broadcast a hex-encoded, serialized transaction to the network. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* rawtx = @"rawtx_example"; // hex-encoded serialized transaction string. + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Broadcast a hex-encoded, serialized transaction to the network. +[apiInstance transactionInjectWithRawtx:rawtx + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->transactionInject: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **rawtx** | **NSString***| hex-encoded serialized transaction string. | + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **transactionRaw** +```objc +-(NSURLSessionTask*) transactionRawWithTxid: (NSString*) txid + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. + +### Example +```objc + +NSString* txid = @"txid_example"; // Transaction id hash (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. +[apiInstance transactionRawWithTxid:txid + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->transactionRaw: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **txid** | **NSString***| Transaction id hash | [optional] + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **transactionVerify** +```objc +-(NSURLSessionTask*) transactionVerifyWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler; +``` + + + +Decode and verify an encoded transaction + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance transactionVerifyWithCompletionHandler: + ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->transactionVerify: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **transactionsGet** +```objc +-(NSURLSessionTask*) transactionsGetWithAddrs: (NSString*) addrs + confirmed: (NSString*) confirmed + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns transactions that match the filters. + +### Example +```objc + +NSString* addrs = @"addrs_example"; // command separated list of addresses (optional) +NSString* confirmed = @"confirmed_example"; // Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns transactions that match the filters. +[apiInstance transactionsGetWithAddrs:addrs + confirmed:confirmed + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->transactionsGet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addrs** | **NSString***| command separated list of addresses | [optional] + **confirmed** | **NSString***| Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] | [optional] + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **transactionsPost** +```objc +-(NSURLSessionTask*) transactionsPostWithAddrs: (NSString*) addrs + confirmed: (NSString*) confirmed + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns transactions that match the filters. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* addrs = @"addrs_example"; // command separated list of addresses (optional) +NSString* confirmed = @"confirmed_example"; // Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns transactions that match the filters. +[apiInstance transactionsPostWithAddrs:addrs + confirmed:confirmed + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->transactionsPost: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addrs** | **NSString***| command separated list of addresses | [optional] + **confirmed** | **NSString***| Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] | [optional] + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uxout** +```objc +-(NSURLSessionTask*) uxoutWithUxid: (NSString*) uxid + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns an unspent output by ID. + +### Example +```objc + +NSString* uxid = @"uxid_example"; // uxid to filter by (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns an unspent output by ID. +[apiInstance uxoutWithUxid:uxid + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->uxout: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uxid** | **NSString***| uxid to filter by | [optional] + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **verifyAddress** +```objc +-(NSURLSessionTask*) verifyAddressWithAddress: (NSString*) address + completionHandler: (void (^)(OAIInlineResponse2007* output, NSError* error)) handler; +``` + +Verifies a Skycoin address. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* address = @"address_example"; // Address id. + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Verifies a Skycoin address. +[apiInstance verifyAddressWithAddress:address + completionHandler: ^(OAIInlineResponse2007* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->verifyAddress: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **address** | **NSString***| Address id. | + +### Return type + +[**OAIInlineResponse2007***](OAIInlineResponse2007.md) + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **version** +```objc +-(NSURLSessionTask*) versionWithCompletionHandler: + (void (^)(NSError* error)) handler; +``` + + + +versionHandler returns the application version info + +### Example +```objc + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance versionWithCompletionHandler: + ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIDefaultApi->version: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **wallet** +```objc +-(NSURLSessionTask*) walletWithId: (NSString*) _id + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns a wallet by id. + +### Example +```objc + +NSString* _id = @"_id_example"; // tags to filter by + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns a wallet by id. +[apiInstance walletWithId:_id + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->wallet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | **NSString***| tags to filter by | + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletBalance** +```objc +-(NSURLSessionTask*) walletBalanceWithId: (NSString*) _id + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Returns the wallet's balance, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + +### Example +```objc + +NSString* _id = @"_id_example"; // tags to filter by + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Returns the wallet's balance, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. +[apiInstance walletBalanceWithId:_id + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletBalance: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | **NSString***| tags to filter by | + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletCreate** +```objc +-(NSURLSessionTask*) walletCreateWithSeed: (NSString*) seed + label: (NSString*) label + scan: (NSNumber*) scan + encrypt: (NSNumber*) encrypt + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + + + +Loads wallet from seed, will scan ahead N address and load addresses till the last one that have coins. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* seed = @"seed_example"; // Wallet seed. +NSString* label = @"label_example"; // Wallet label. +NSNumber* scan = @56; // The number of addresses to scan ahead for balances. (optional) +NSNumber* encrypt = @56; // Encrypt wallet. (optional) +NSString* password = @"password_example"; // Wallet Password (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance walletCreateWithSeed:seed + label:label + scan:scan + encrypt:encrypt + password:password + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletCreate: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **seed** | **NSString***| Wallet seed. | + **label** | **NSString***| Wallet label. | + **scan** | **NSNumber***| The number of addresses to scan ahead for balances. | [optional] + **encrypt** | **NSNumber***| Encrypt wallet. | [optional] + **password** | **NSString***| Wallet Password | [optional] + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletDecrypt** +```objc +-(NSURLSessionTask*) walletDecryptWithId: (NSString*) _id + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Decrypts wallet. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* _id = @"_id_example"; // Wallet id. +NSString* password = @"password_example"; // Wallet password. + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Decrypts wallet. +[apiInstance walletDecryptWithId:_id + password:password + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletDecrypt: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | **NSString***| Wallet id. | + **password** | **NSString***| Wallet password. | + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletEncrypt** +```objc +-(NSURLSessionTask*) walletEncryptWithId: (NSString*) _id + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Encrypt wallet. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* _id = @"_id_example"; // Wallet id. +NSString* password = @"password_example"; // Wallet password. + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Encrypt wallet. +[apiInstance walletEncryptWithId:_id + password:password + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletEncrypt: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | **NSString***| Wallet id. | + **password** | **NSString***| Wallet password. | + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletFolder** +```objc +-(NSURLSessionTask*) walletFolderWithAddr: (NSString*) addr + completionHandler: (void (^)(OAIInlineResponse2006* output, NSError* error)) handler; +``` + + + +Returns the wallet directory path + +### Example +```objc + +NSString* addr = @"addr_example"; // Address port + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance walletFolderWithAddr:addr + completionHandler: ^(OAIInlineResponse2006* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletFolder: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addr** | **NSString***| Address port | + +### Return type + +[**OAIInlineResponse2006***](OAIInlineResponse2006.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletNewAddress** +```objc +-(NSURLSessionTask*) walletNewAddressWithId: (NSString*) _id + num: (NSString*) num + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + + + +Generates new addresses + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* _id = @"_id_example"; // Wallet Id +NSString* num = @"num_example"; // The number you want to generate (optional) +NSString* password = @"password_example"; // Wallet Password (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance walletNewAddressWithId:_id + num:num + password:password + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletNewAddress: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | **NSString***| Wallet Id | + **num** | **NSString***| The number you want to generate | [optional] + **password** | **NSString***| Wallet Password | [optional] + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletNewSeed** +```objc +-(NSURLSessionTask*) walletNewSeedWithEntropy: (NSString*) entropy + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + + + +Returns the wallet directory path + +### Example +```objc + +NSString* entropy = @"entropy_example"; // Entropy bitSize. (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance walletNewSeedWithEntropy:entropy + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletNewSeed: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **entropy** | **NSString***| Entropy bitSize. | [optional] + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletRecover** +```objc +-(NSURLSessionTask*) walletRecoverWithId: (NSString*) _id + seed: (NSString*) seed + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +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 +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* _id = @"_id_example"; // Wallet id. +NSString* seed = @"seed_example"; // Wallet seed. +NSString* password = @"password_example"; // Wallet password. (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// 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. +[apiInstance walletRecoverWithId:_id + seed:seed + password:password + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletRecover: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | **NSString***| Wallet id. | + **seed** | **NSString***| Wallet seed. | + **password** | **NSString***| Wallet password. | [optional] + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletSeed** +```objc +-(NSURLSessionTask*) walletSeedWithId: (NSString*) _id + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +This endpoint only works for encrypted wallets. If the wallet is unencrypted, The seed will be not returned. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* _id = @"_id_example"; // Wallet Id. +NSString* password = @"password_example"; // Wallet password. + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// This endpoint only works for encrypted wallets. If the wallet is unencrypted, The seed will be not returned. +[apiInstance walletSeedWithId:_id + password:password + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletSeed: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | **NSString***| Wallet Id. | + **password** | **NSString***| Wallet password. | + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletSeedVerify** +```objc +-(NSURLSessionTask*) walletSeedVerifyWithSeed: (NSString*) seed + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + +Verifies a wallet seed. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* seed = @"seed_example"; // Seed to be verified. (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Verifies a wallet seed. +[apiInstance walletSeedVerifyWithSeed:seed + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletSeedVerify: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **seed** | **NSString***| Seed to be verified. | [optional] + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletSpent** +```objc +-(NSURLSessionTask*) walletSpentWithId: (NSString*) _id + dst: (NSString*) dst + coins: (NSString*) coins + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + + + +Creates and broadcasts a transaction sending money from one of our wallets to destination address. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* _id = @"_id_example"; // Wallet id +NSString* dst = @"dst_example"; // Recipient address +NSString* coins = @"coins_example"; // Number of coins to spend, in droplets. 1 coin equals 1e6 droplets. +NSString* password = @"password_example"; // Wallet password. + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance walletSpentWithId:_id + dst:dst + coins:coins + password:password + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletSpent: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | **NSString***| Wallet id | + **dst** | **NSString***| Recipient address | + **coins** | **NSString***| Number of coins to spend, in droplets. 1 coin equals 1e6 droplets. | + **password** | **NSString***| Wallet password. | + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletTransaction** +```objc +-(NSURLSessionTask*) walletTransactionWithInlineObject: (OAIInlineObject*) inlineObject + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + + + +Creates a signed transaction + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +OAIInlineObject* inlineObject = [[OAIInlineObject alloc] init]; // (optional) + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance walletTransactionWithInlineObject:inlineObject + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletTransaction: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inlineObject** | [**OAIInlineObject***](OAIInlineObject.md)| | [optional] + +### Return type + +**NSObject*** + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletTransactions** +```objc +-(NSURLSessionTask*) walletTransactionsWithId: (NSString*) _id + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; +``` + + + +Returns returns all unconfirmed transactions for all addresses in a given wallet verbose + +### Example +```objc + +NSString* _id = @"_id_example"; // Wallet id. + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance walletTransactionsWithId:_id + completionHandler: ^(NSObject* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletTransactions: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | **NSString***| Wallet id. | + +### Return type + +**NSObject*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletUnload** +```objc +-(NSURLSessionTask*) walletUnloadWithId: (NSString*) _id + completionHandler: (void (^)(NSError* error)) handler; +``` + +Unloads wallet from the wallet service. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* _id = @"_id_example"; // Wallet Id. + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Unloads wallet from the wallet service. +[apiInstance walletUnloadWithId:_id + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletUnload: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | **NSString***| Wallet Id. | + +### Return type + +void (empty response body) + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **walletUpdate** +```objc +-(NSURLSessionTask*) walletUpdateWithId: (NSString*) _id + label: (NSString*) label + completionHandler: (void (^)(NSError* error)) handler; +``` + +Update the wallet. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: csrfAuth) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-CSRF-TOKEN"]; + + +NSString* _id = @"_id_example"; // Wallet Id. +NSString* label = @"label_example"; // The label the wallet will be updated to. + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +// Update the wallet. +[apiInstance walletUpdateWithId:_id + label:label + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIDefaultApi->walletUpdate: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_id** | **NSString***| Wallet Id. | + **label** | **NSString***| The label the wallet will be updated to. | + +### Return type + +void (empty response body) + +### Authorization + +[csrfAuth](../README.md#csrfAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **wallets** +```objc +-(NSURLSessionTask*) walletsWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler; +``` + + + +Returns all loaded wallets + +### Example +```objc + + +OAIDefaultApi*apiInstance = [[OAIDefaultApi alloc] init]; + +[apiInstance walletsWithCompletionHandler: + ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIDefaultApi->wallets: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**NSArray***](OAIInlineResponse2005.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/lib/skyapi/docs/OAIInlineObject.md b/lib/skyapi/docs/OAIInlineObject.md new file mode 100644 index 0000000..8a014ad --- /dev/null +++ b/lib/skyapi/docs/OAIInlineObject.md @@ -0,0 +1,14 @@ +# OAIInlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**changeAddress** | **NSString*** | | [optional] +**hoursSelection** | [**OAIApiv1wallettransactionHoursSelection***](OAIApiv1wallettransactionHoursSelection.md) | | [optional] +**ignoreUnconfirmed** | **NSNumber*** | | [optional] +**to** | [**NSArray<OAIApiv1wallettransactionTo>***](OAIApiv1wallettransactionTo.md) | | [optional] +**wallet** | [**OAIApiv1wallettransactionWallet***](OAIApiv1wallettransactionWallet.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIInlineResponse200.md b/lib/skyapi/docs/OAIInlineResponse200.md new file mode 100644 index 0000000..103350f --- /dev/null +++ b/lib/skyapi/docs/OAIInlineResponse200.md @@ -0,0 +1,18 @@ +# OAIInlineResponse200 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hours** | **NSNumber*** | | [optional] +**coins** | **NSNumber*** | | [optional] +**uxid** | **NSString*** | | [optional] +**ownerAddress** | **NSString*** | | [optional] +**spentBlockSeq** | **NSNumber*** | | [optional] +**spentTx** | **NSString*** | | [optional] +**time** | **NSNumber*** | | [optional] +**srcBlockSeq** | **NSNumber*** | | [optional] +**srcTx** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIInlineResponse2001.md b/lib/skyapi/docs/OAIInlineResponse2001.md new file mode 100644 index 0000000..c529677 --- /dev/null +++ b/lib/skyapi/docs/OAIInlineResponse2001.md @@ -0,0 +1,10 @@ +# OAIInlineResponse2001 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**csrfToken** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIInlineResponse2002.md b/lib/skyapi/docs/OAIInlineResponse2002.md new file mode 100644 index 0000000..80610b1 --- /dev/null +++ b/lib/skyapi/docs/OAIInlineResponse2002.md @@ -0,0 +1,19 @@ +# OAIInlineResponse2002 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**outputs** | [**NSArray<OAIApiv1exploreraddressOutputs>***](OAIApiv1exploreraddressOutputs.md) | | [optional] +**innerHash** | **NSString*** | | [optional] +**inputs** | [**NSArray<OAIApiv1exploreraddressInputs>***](OAIApiv1exploreraddressInputs.md) | | [optional] +**fee** | **NSNumber*** | | [optional] +**sigs** | **NSArray<NSString*>*** | | [optional] +**length** | **NSNumber*** | | [optional] +**txid** | **NSString*** | | [optional] +**type** | **NSNumber*** | | [optional] +**status** | [**OAIApiv1exploreraddressStatus***](OAIApiv1exploreraddressStatus.md) | | [optional] +**timestamp** | **NSNumber*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIInlineResponse2003.md b/lib/skyapi/docs/OAIInlineResponse2003.md new file mode 100644 index 0000000..3367592 --- /dev/null +++ b/lib/skyapi/docs/OAIInlineResponse2003.md @@ -0,0 +1,22 @@ +# OAIInlineResponse2003 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lastReceived** | **NSNumber*** | | [optional] +**lastSent** | **NSNumber*** | | [optional] +**outgoing** | **NSNumber*** | | [optional] +**mirror** | **NSNumber*** | | [optional] +**address** | **NSString*** | | [optional] +**listenPort** | **NSNumber*** | | [optional] +**isTrustedPeer** | **NSNumber*** | | [optional] +**connectedAt** | **NSNumber*** | | [optional] +**unconfirmedVerifyTransaction** | [**OAIInlineResponse2003UnconfirmedVerifyTransaction***](OAIInlineResponse2003UnconfirmedVerifyTransaction.md) | | [optional] +**_id** | **NSNumber*** | | [optional] +**state** | **NSString*** | | [optional] +**userAgent** | **NSString*** | | [optional] +**height** | **NSNumber*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIInlineResponse2003UnconfirmedVerifyTransaction.md b/lib/skyapi/docs/OAIInlineResponse2003UnconfirmedVerifyTransaction.md new file mode 100644 index 0000000..55dba22 --- /dev/null +++ b/lib/skyapi/docs/OAIInlineResponse2003UnconfirmedVerifyTransaction.md @@ -0,0 +1,12 @@ +# OAIInlineResponse2003UnconfirmedVerifyTransaction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**burnFactor** | **NSNumber*** | | [optional] +**maxTransactionSize** | **NSNumber*** | | [optional] +**maxDecimals** | **NSNumber*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIInlineResponse2004.md b/lib/skyapi/docs/OAIInlineResponse2004.md new file mode 100644 index 0000000..93800f6 --- /dev/null +++ b/lib/skyapi/docs/OAIInlineResponse2004.md @@ -0,0 +1,14 @@ +# OAIInlineResponse2004 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**announced** | **NSString*** | | [optional] +**isValid** | **NSNumber*** | | [optional] +**checked** | **NSString*** | | [optional] +**received** | **NSString*** | | [optional] +**transaction** | [**OAIApiv1pendingTxsTransaction***](OAIApiv1pendingTxsTransaction.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIInlineResponse2005.md b/lib/skyapi/docs/OAIInlineResponse2005.md new file mode 100644 index 0000000..95e3074 --- /dev/null +++ b/lib/skyapi/docs/OAIInlineResponse2005.md @@ -0,0 +1,11 @@ +# OAIInlineResponse2005 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entries** | [**NSArray<OAIApiv1walletsEntries>***](OAIApiv1walletsEntries.md) | | [optional] +**meta** | [**OAIApiv1walletsMeta***](OAIApiv1walletsMeta.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIInlineResponse2006.md b/lib/skyapi/docs/OAIInlineResponse2006.md new file mode 100644 index 0000000..47ef3f7 --- /dev/null +++ b/lib/skyapi/docs/OAIInlineResponse2006.md @@ -0,0 +1,10 @@ +# OAIInlineResponse2006 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIInlineResponse2007.md b/lib/skyapi/docs/OAIInlineResponse2007.md new file mode 100644 index 0000000..fda3b8b --- /dev/null +++ b/lib/skyapi/docs/OAIInlineResponse2007.md @@ -0,0 +1,11 @@ +# OAIInlineResponse2007 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**OAIInlineResponse2007Data***](OAIInlineResponse2007Data.md) | | [optional] +**error** | [**NSObject***](.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIInlineResponse2007Data.md b/lib/skyapi/docs/OAIInlineResponse2007Data.md new file mode 100644 index 0000000..0ffd00b --- /dev/null +++ b/lib/skyapi/docs/OAIInlineResponse2007Data.md @@ -0,0 +1,10 @@ +# OAIInlineResponse2007Data + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | **NSNumber*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/docs/OAIInlineResponseDefault.md b/lib/skyapi/docs/OAIInlineResponseDefault.md new file mode 100644 index 0000000..4375a09 --- /dev/null +++ b/lib/skyapi/docs/OAIInlineResponseDefault.md @@ -0,0 +1,11 @@ +# OAIInlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **NSNumber*** | | [optional] +**message** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lib/skyapi/git_push.sh b/lib/skyapi/git_push.sh new file mode 100644 index 0000000..8442b80 --- /dev/null +++ b/lib/skyapi/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/lib/skyapi/skyapi.podspec b/lib/skyapi/skyapi.podspec new file mode 100644 index 0000000..78559d7 --- /dev/null +++ b/lib/skyapi/skyapi.podspec @@ -0,0 +1,37 @@ +# +# Be sure to run `pod lib lint skyapi.podspec' to ensure this is a +# valid spec and remove all comments before submitting the spec. +# +# Any lines starting with a # are optional, but encouraged +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# + +Pod::Spec.new do |s| + s.name = "skyapi" + s.version = "v0.25.1" + + s.summary = "Skycoin REST API." + s.description = <<-DESC + Skycoin is a next-generation cryptocurrency. + DESC + + s.platform = :ios, '7.0' + s.requires_arc = true + + s.framework = 'SystemConfiguration' + + s.homepage = "https://github.com/openapitools/openapi-generator" + s.license = "Proprietary" + s.source = { :git => "https://github.com/openapitools/openapi-generator.git", :tag => "#{s.version}" } + s.author = { "OpenAPI" => "team@openapitools.org" } + + s.source_files = 'skyapi/**/*.{m,h}' + s.public_header_files = 'skyapi/**/*.h' + + + s.dependency 'AFNetworking', '~> 3' + s.dependency 'JSONModel', '~> 1.2' + s.dependency 'ISO8601', '~> 0.6' +end + diff --git a/lib/skyapi/skyapi/Api/OAIDefaultApi.h b/lib/skyapi/skyapi/Api/OAIDefaultApi.h new file mode 100644 index 0000000..1811379 --- /dev/null +++ b/lib/skyapi/skyapi/Api/OAIDefaultApi.h @@ -0,0 +1,740 @@ +#import +#import "OAIInlineObject.h" +#import "OAIInlineResponse200.h" +#import "OAIInlineResponse2001.h" +#import "OAIInlineResponse2002.h" +#import "OAIInlineResponse2003.h" +#import "OAIInlineResponse2004.h" +#import "OAIInlineResponse2005.h" +#import "OAIInlineResponse2006.h" +#import "OAIInlineResponse2007.h" +#import "OAIInlineResponseDefault.h" +#import "OAIApi.h" + +/** +* 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. +*/ + + + +@interface OAIDefaultApi: NSObject + +extern NSString* kOAIDefaultApiErrorDomain; +extern NSInteger kOAIDefaultApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Returns the total number of unique address that have coins. +/// +/// +/// +/// code:200 message:"This endpoint Returns the total number of unique address that have coins.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) addressCountWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// Returns the historical, spent outputs associated with an address +/// +/// @param address address to filter by +/// +/// code:200 message:"Response for endpoint /api/v1/address_uxouts", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSArray* +-(NSURLSessionTask*) addressUxoutsWithAddress: (NSString*) address + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; + + +/// 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 +/// +/// code:200 message:"Returns the balance of one or more addresses", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) balanceGetWithAddrs: (NSString*) addrs + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// 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 +/// +/// code:200 message:"Returns the balance of one or more addresses", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) balancePostWithAddrs: (NSString*) addrs + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// Returns a block by hash or seq. Note: only one of hash or seq is allowed +/// +/// @param hash (optional) +/// @param seq (optional) +/// +/// code:200 message:"BlockVerbose represents a readable block with verbose data.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) blockWithHash: (NSString*) hash + seq: (NSNumber*) seq + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// Returns the blockchain metadata. +/// +/// +/// +/// code:200 message:"This endpoint returns the blockchain metadata.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) blockchainMetadataWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler; + + +/// Returns the blockchain sync progress. +/// +/// +/// +/// code:200 message:"This endpoint returns the blockchain sync progress", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) blockchainProgressWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler; + + +/// 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 (optional) +/// @param end (optional) +/// @param seqs (optional) +/// +/// code:200 message:"Returns blocks between a start and end point.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) blocksGetWithStart: (NSNumber*) start + end: (NSNumber*) end + seqs: (NSArray*) seqs + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// 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 (optional) +/// @param end (optional) +/// @param seqs (optional) +/// +/// code:200 message:"Returns blocks between a start and end point.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) blocksPostWithStart: (NSNumber*) start + end: (NSNumber*) end + seqs: (NSArray*) seqs + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// coinSupplyHandler returns coin distribution supply stats +/// +/// +/// code:200 message:"CoinSupply records the coin supply info.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return void +-(NSURLSessionTask*) coinSupplyWithCompletionHandler: + (void (^)(NSError* error)) handler; + + +/// Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. +/// +/// +/// +/// code:200 message:"Return a csrf Token.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return OAIInlineResponse2001* +-(NSURLSessionTask*) csrfWithCompletionHandler: + (void (^)(OAIInlineResponse2001* output, NSError* error)) handler; + + +/// defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. +/// +/// +/// +/// code:200 message:"This endpoint return an list of default connections.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSArray* +-(NSURLSessionTask*) defaultConnectionsWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler; + + +/// +/// Returns all transactions (confirmed and unconfirmed) for an address +/// +/// @param address tags to filter by (optional) +/// +/// code:200 message:"Response for endpoint /api/v1/explorer/address", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSArray* +-(NSURLSessionTask*) explorerAddressWithAddress: (NSString*) address + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; + + +/// Returns node health data. +/// +/// +/// +/// code:200 message:"This endpoint returns node health data.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) healthWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// Returns the most recent N blocks on the blockchain +/// +/// @param num +/// +/// code:200 message:"Returns the most recent N blocks on the blockchain.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) lastBlocksWithNum: (NSNumber*) num + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// This endpoint returns a specific connection. +/// +/// +/// @param addr Address port +/// +/// code:200 message:"This endpoint return a connection struct", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return OAIInlineResponse2003* +-(NSURLSessionTask*) networkConnectionWithAddr: (NSString*) addr + completionHandler: (void (^)(OAIInlineResponse2003* output, NSError* error)) handler; + + +/// This endpoint returns all outgoings connections. +/// +/// +/// @param states Connection status. (optional) +/// @param direction Direction of the connection. (optional) +/// +/// code:200 message:"This endpoint return a connection struct", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSArray* +-(NSURLSessionTask*) networkConnectionsWithStates: (NSString*) states + direction: (NSString*) direction + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; + + +/// +/// This endpoint disconnects a connection by ID or address +/// +/// @param _id Address id. +/// +/// code:200 message:"This endpoint", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return void +-(NSURLSessionTask*) networkConnectionsDisconnectWithId: (NSString*) _id + completionHandler: (void (^)(NSError* error)) handler; + + +/// +/// This endpoint returns all connections found through peer exchange +/// +/// +/// code:200 message:"This endpoint return a list of all connections found through peer exchange.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSArray* +-(NSURLSessionTask*) networkConnectionsExchangeWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler; + + +/// 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. +/// +/// +/// +/// code:200 message:"This endpoint return a list of trusted connections.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSArray* +-(NSURLSessionTask*) networkConnectionsTrustWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler; + + +/// 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 (optional) +/// @param hash (optional) +/// +/// code:200 message:"UnspentOutputsSummary records unspent outputs in different status.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) outputsGetWithAddress: (NSArray*) address + hash: (NSArray*) hash + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// 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 (optional) +/// @param hash (optional) +/// +/// code:200 message:"UnspentOutputsSummary records unspent outputs in different status.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) outputsPostWithAddress: (NSString*) address + hash: (NSString*) hash + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// Returns pending (unconfirmed) transactions without verbose +/// +/// +/// code:200 message:"Returns a transaction identified by its txid hash.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSArray* +-(NSURLSessionTask*) pendingTxsWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler; + + +/// +/// Broadcasts all unconfirmed transactions from the unconfirmed transaction pool +/// +/// +/// code:200 message:"OK, Broadcasts all unconfirmed transactions from the unconfirmed transaction pool", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return void +-(NSURLSessionTask*) resendUnconfirmedTxnsWithCompletionHandler: + (void (^)(NSError* error)) handler; + + +/// Returns the top skycoin holders. +/// +/// +/// @param includeDistribution include distribution addresses or not, default value false (optional) +/// @param n include distribution addresses or not, default value false (optional) +/// +/// code:200 message:"Response for endpoint /api/v1/address_uxouts", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) richlistWithIncludeDistribution: (NSNumber*) includeDistribution + n: (NSString*) n + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// Returns a transaction identified by its txid hash with just id +/// +/// @param txid transaction hash +/// @param encoded return as a raw encoded transaction. (optional) +/// +/// code:200 message:"Returns a transaction identified by its txid hash.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) transactionWithTxid: (NSString*) txid + encoded: (NSNumber*) encoded + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// Broadcast a hex-encoded, serialized transaction to the network. +/// +/// +/// @param rawtx hex-encoded serialized transaction string. +/// +/// code:200 message:"Ok, returns the transaction.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) transactionInjectWithRawtx: (NSString*) rawtx + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. +/// +/// +/// @param txid Transaction id hash (optional) +/// +/// code:200 message:"Returns the hex-encoded byte serialization of a transaction", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) transactionRawWithTxid: (NSString*) txid + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// Decode and verify an encoded transaction +/// +/// +/// code:200 message:"Responses ok", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) transactionVerifyWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler; + + +/// Returns transactions that match the filters. +/// +/// +/// @param addrs command separated list of addresses (optional) +/// @param confirmed Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] (optional) +/// +/// code:200 message:"Returns transactions that match the filters.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) transactionsGetWithAddrs: (NSString*) addrs + confirmed: (NSString*) confirmed + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// Returns transactions that match the filters. +/// +/// +/// @param addrs command separated list of addresses (optional) +/// @param confirmed Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] (optional) +/// +/// code:200 message:"Returns transactions that match the filters.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) transactionsPostWithAddrs: (NSString*) addrs + confirmed: (NSString*) confirmed + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// Returns an unspent output by ID. +/// +/// +/// @param uxid uxid to filter by (optional) +/// +/// code:200 message:"Response for endpoint /api/v1/uxout", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) uxoutWithUxid: (NSString*) uxid + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// Verifies a Skycoin address. +/// +/// +/// @param address Address id. +/// +/// code:200 message:"Response verifies a Skycoin address", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return OAIInlineResponse2007* +-(NSURLSessionTask*) verifyAddressWithAddress: (NSString*) address + completionHandler: (void (^)(OAIInlineResponse2007* output, NSError* error)) handler; + + +/// +/// versionHandler returns the application version info +/// +/// +/// code:200 message:"BuildInfo represents the build info", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return void +-(NSURLSessionTask*) versionWithCompletionHandler: + (void (^)(NSError* error)) handler; + + +/// Returns a wallet by id. +/// +/// +/// @param _id tags to filter by +/// +/// code:200 message:"Response for endpoint /api/v1/wallet", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletWithId: (NSString*) _id + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// 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 +/// +/// code:200 message:"Returns the wallets balance", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletBalanceWithId: (NSString*) _id + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// 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. (optional) +/// @param encrypt Encrypt wallet. (optional) +/// @param password Wallet Password (optional) +/// +/// code:200 message:"This endpoint loads wallets from seed", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletCreateWithSeed: (NSString*) seed + label: (NSString*) label + scan: (NSNumber*) scan + encrypt: (NSNumber*) encrypt + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// Decrypts wallet. +/// +/// +/// @param _id Wallet id. +/// @param password Wallet password. +/// +/// code:200 message:"This endpoint decrypts wallets.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletDecryptWithId: (NSString*) _id + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// Encrypt wallet. +/// +/// +/// @param _id Wallet id. +/// @param password Wallet password. +/// +/// code:200 message:"This endpoint encrypt wallets.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletEncryptWithId: (NSString*) _id + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// Returns the wallet directory path +/// +/// @param addr Address port +/// +/// code:200 message:"This endpoint return the wallet directory path", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return OAIInlineResponse2006* +-(NSURLSessionTask*) walletFolderWithAddr: (NSString*) addr + completionHandler: (void (^)(OAIInlineResponse2006* output, NSError* error)) handler; + + +/// +/// Generates new addresses +/// +/// @param _id Wallet Id +/// @param num The number you want to generate (optional) +/// @param password Wallet Password (optional) +/// +/// code:200 message:"This endpoint generate new addresses", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletNewAddressWithId: (NSString*) _id + num: (NSString*) num + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// Returns the wallet directory path +/// +/// @param entropy Entropy bitSize. (optional) +/// +/// code:200 message:"Generates wallet seed", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletNewSeedWithEntropy: (NSString*) entropy + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// 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. (optional) +/// +/// code:200 message:"This endpoint decrypts wallets.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletRecoverWithId: (NSString*) _id + seed: (NSString*) seed + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// 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. +/// +/// code:200 message:"This endpoint Returns seed of wallet of given id", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletSeedWithId: (NSString*) _id + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// Verifies a wallet seed. +/// +/// +/// @param seed Seed to be verified. (optional) +/// +/// code:200 message:"Verifies a wallet seed.", +/// code:422 message:"Wrong Seed", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletSeedVerifyWithSeed: (NSString*) seed + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// 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. +/// +/// code:200 message:"Creates and broadcasts a transaction sending money from one of our wallets to destination address.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletSpentWithId: (NSString*) _id + dst: (NSString*) dst + coins: (NSString*) coins + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// Creates a signed transaction +/// +/// @param inlineObject (optional) +/// +/// code:200 message:"Returns blocks between a start and end point.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletTransactionWithInlineObject: (OAIInlineObject*) inlineObject + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// +/// Returns returns all unconfirmed transactions for all addresses in a given wallet verbose +/// +/// @param _id Wallet id. +/// +/// code:200 message:"Returns returns all unconfirmed transactions for all addresses in a given wallet", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSObject* +-(NSURLSessionTask*) walletTransactionsWithId: (NSString*) _id + completionHandler: (void (^)(NSObject* output, NSError* error)) handler; + + +/// Unloads wallet from the wallet service. +/// +/// +/// @param _id Wallet Id. +/// +/// code:200 message:"This endpoint returns nothing.", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return void +-(NSURLSessionTask*) walletUnloadWithId: (NSString*) _id + completionHandler: (void (^)(NSError* error)) handler; + + +/// Update the wallet. +/// +/// +/// @param _id Wallet Id. +/// @param label The label the wallet will be updated to. +/// +/// code:200 message:"This endpoint Returns the label the wallet will be updated to .", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return void +-(NSURLSessionTask*) walletUpdateWithId: (NSString*) _id + label: (NSString*) label + completionHandler: (void (^)(NSError* error)) handler; + + +/// +/// Returns all loaded wallets +/// +/// +/// code:200 message:"This endpoint return all loaded wallets", +/// code:0 message:"A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures." +/// +/// @return NSArray* +-(NSURLSessionTask*) walletsWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler; + + + +@end diff --git a/lib/skyapi/skyapi/Api/OAIDefaultApi.m b/lib/skyapi/skyapi/Api/OAIDefaultApi.m new file mode 100644 index 0000000..e159e7b --- /dev/null +++ b/lib/skyapi/skyapi/Api/OAIDefaultApi.m @@ -0,0 +1,3401 @@ +#import "OAIDefaultApi.h" +#import "OAIQueryParamCollection.h" +#import "OAIApiClient.h" +#import "OAIInlineObject.h" +#import "OAIInlineResponse200.h" +#import "OAIInlineResponse2001.h" +#import "OAIInlineResponse2002.h" +#import "OAIInlineResponse2003.h" +#import "OAIInlineResponse2004.h" +#import "OAIInlineResponse2005.h" +#import "OAIInlineResponse2006.h" +#import "OAIInlineResponse2007.h" +#import "OAIInlineResponseDefault.h" + + +@interface OAIDefaultApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation OAIDefaultApi + +NSString* kOAIDefaultApiErrorDomain = @"OAIDefaultApiErrorDomain"; +NSInteger kOAIDefaultApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[OAIApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Returns the total number of unique address that have coins. +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) addressCountWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/addresscount"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// Returns the historical, spent outputs associated with an address +/// @param address address to filter by +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) addressUxoutsWithAddress: (NSString*) address + completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + // verify the required parameter 'address' is set + if (address == nil) { + NSParameterAssert(address); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"address"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/address_uxouts"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (address != nil) { + queryParams[@"address"] = address; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// 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 +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) balanceGetWithAddrs: (NSString*) addrs + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter 'addrs' is set + if (addrs == nil) { + NSParameterAssert(addrs); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"addrs"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/balance"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (addrs != nil) { + queryParams[@"addrs"] = addrs; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// 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 +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) balancePostWithAddrs: (NSString*) addrs + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter 'addrs' is set + if (addrs == nil) { + NSParameterAssert(addrs); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"addrs"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/balance"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (addrs != nil) { + queryParams[@"addrs"] = addrs; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// Returns a block by hash or seq. Note: only one of hash or seq is allowed +/// @param hash (optional) +/// +/// @param seq (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) blockWithHash: (NSString*) hash + seq: (NSNumber*) seq + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/block"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (hash != nil) { + queryParams[@"hash"] = hash; + } + if (seq != nil) { + queryParams[@"seq"] = seq; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// Returns the blockchain metadata. +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) blockchainMetadataWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/blockchain/metadata"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// Returns the blockchain sync progress. +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) blockchainProgressWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/blockchain/progress"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// 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 (optional) +/// +/// @param end (optional) +/// +/// @param seqs (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) blocksGetWithStart: (NSNumber*) start + end: (NSNumber*) end + seqs: (NSArray*) seqs + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/blocks"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (start != nil) { + queryParams[@"start"] = start; + } + if (end != nil) { + queryParams[@"end"] = end; + } + if (seqs != nil) { + queryParams[@"seqs"] = [[OAIQueryParamCollection alloc] initWithValuesAndFormat: seqs format: @"csv"]; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// 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 (optional) +/// +/// @param end (optional) +/// +/// @param seqs (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) blocksPostWithStart: (NSNumber*) start + end: (NSNumber*) end + seqs: (NSArray*) seqs + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/blocks"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (start != nil) { + queryParams[@"start"] = start; + } + if (end != nil) { + queryParams[@"end"] = end; + } + if (seqs != nil) { + queryParams[@"seqs"] = [[OAIQueryParamCollection alloc] initWithValuesAndFormat: seqs format: @"csv"]; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// coinSupplyHandler returns coin distribution supply stats +/// @returns void +/// +-(NSURLSessionTask*) coinSupplyWithCompletionHandler: + (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/coinSupply"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. +/// +/// @returns OAIInlineResponse2001* +/// +-(NSURLSessionTask*) csrfWithCompletionHandler: + (void (^)(OAIInlineResponse2001* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/csrf"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"OAIInlineResponse2001*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((OAIInlineResponse2001*)data, error); + } + }]; +} + +/// +/// defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) defaultConnectionsWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/network/defaultConnections"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// +/// Returns all transactions (confirmed and unconfirmed) for an address +/// @param address tags to filter by (optional) +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) explorerAddressWithAddress: (NSString*) address + completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/explorer/address"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (address != nil) { + queryParams[@"address"] = address; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// Returns node health data. +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) healthWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/health"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// Returns the most recent N blocks on the blockchain +/// @param num +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) lastBlocksWithNum: (NSNumber*) num + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter 'num' is set + if (num == nil) { + NSParameterAssert(num); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"num"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/last_blocks"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (num != nil) { + queryParams[@"num"] = num; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// This endpoint returns a specific connection. +/// +/// @param addr Address port +/// +/// @returns OAIInlineResponse2003* +/// +-(NSURLSessionTask*) networkConnectionWithAddr: (NSString*) addr + completionHandler: (void (^)(OAIInlineResponse2003* output, NSError* error)) handler { + // verify the required parameter 'addr' is set + if (addr == nil) { + NSParameterAssert(addr); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"addr"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/network/connection"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (addr != nil) { + queryParams[@"addr"] = addr; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"OAIInlineResponse2003*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((OAIInlineResponse2003*)data, error); + } + }]; +} + +/// +/// This endpoint returns all outgoings connections. +/// +/// @param states Connection status. (optional) +/// +/// @param direction Direction of the connection. (optional) +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) networkConnectionsWithStates: (NSString*) states + direction: (NSString*) direction + completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/network/connections"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (states != nil) { + queryParams[@"states"] = states; + } + if (direction != nil) { + queryParams[@"direction"] = direction; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// +/// This endpoint disconnects a connection by ID or address +/// @param _id Address id. +/// +/// @returns void +/// +-(NSURLSessionTask*) networkConnectionsDisconnectWithId: (NSString*) _id + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter '_id' is set + if (_id == nil) { + NSParameterAssert(_id); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"_id"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/network/connection/disconnect"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (_id != nil) { + queryParams[@"id"] = _id; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// +/// This endpoint returns all connections found through peer exchange +/// @returns NSArray* +/// +-(NSURLSessionTask*) networkConnectionsExchangeWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/network/connections/exchange"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// 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. +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) networkConnectionsTrustWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/network/connections/trust"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// 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 (optional) +/// +/// @param hash (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) outputsGetWithAddress: (NSArray*) address + hash: (NSArray*) hash + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/outputs"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (address != nil) { + queryParams[@"address"] = [[OAIQueryParamCollection alloc] initWithValuesAndFormat: address format: @"csv"]; + } + if (hash != nil) { + queryParams[@"hash"] = [[OAIQueryParamCollection alloc] initWithValuesAndFormat: hash format: @"csv"]; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// 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 (optional) +/// +/// @param hash (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) outputsPostWithAddress: (NSString*) address + hash: (NSString*) hash + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/outputs"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (address != nil) { + queryParams[@"address"] = address; + } + if (hash != nil) { + queryParams[@"hash"] = hash; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// Returns pending (unconfirmed) transactions without verbose +/// @returns NSArray* +/// +-(NSURLSessionTask*) pendingTxsWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/pendingTxs"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// +/// Broadcasts all unconfirmed transactions from the unconfirmed transaction pool +/// @returns void +/// +-(NSURLSessionTask*) resendUnconfirmedTxnsWithCompletionHandler: + (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/resendUnconfirmedTxns"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Returns the top skycoin holders. +/// +/// @param includeDistribution include distribution addresses or not, default value false (optional) +/// +/// @param n include distribution addresses or not, default value false (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) richlistWithIncludeDistribution: (NSNumber*) includeDistribution + n: (NSString*) n + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/richlist"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (includeDistribution != nil) { + queryParams[@"include-distribution"] = [includeDistribution isEqual:@(YES)] ? @"true" : @"false"; + } + if (n != nil) { + queryParams[@"n"] = n; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// Returns a transaction identified by its txid hash with just id +/// @param txid transaction hash +/// +/// @param encoded return as a raw encoded transaction. (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) transactionWithTxid: (NSString*) txid + encoded: (NSNumber*) encoded + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter 'txid' is set + if (txid == nil) { + NSParameterAssert(txid); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"txid"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/transaction"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (txid != nil) { + queryParams[@"txid"] = txid; + } + if (encoded != nil) { + queryParams[@"encoded"] = [encoded isEqual:@(YES)] ? @"true" : @"false"; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// Broadcast a hex-encoded, serialized transaction to the network. +/// +/// @param rawtx hex-encoded serialized transaction string. +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) transactionInjectWithRawtx: (NSString*) rawtx + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter 'rawtx' is set + if (rawtx == nil) { + NSParameterAssert(rawtx); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"rawtx"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v2/transaction/inject"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + if (rawtx != nil) { + headerParams[@"rawtx"] = rawtx; + } + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. +/// +/// @param txid Transaction id hash (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) transactionRawWithTxid: (NSString*) txid + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v2/transaction/raw"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (txid != nil) { + queryParams[@"txid"] = txid; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// Decode and verify an encoded transaction +/// @returns NSObject* +/// +-(NSURLSessionTask*) transactionVerifyWithCompletionHandler: + (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v2/transaction/verify"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// Returns transactions that match the filters. +/// +/// @param addrs command separated list of addresses (optional) +/// +/// @param confirmed Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) transactionsGetWithAddrs: (NSString*) addrs + confirmed: (NSString*) confirmed + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/transactions"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (addrs != nil) { + queryParams[@"addrs"] = addrs; + } + if (confirmed != nil) { + queryParams[@"confirmed"] = confirmed; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// Returns transactions that match the filters. +/// +/// @param addrs command separated list of addresses (optional) +/// +/// @param confirmed Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) transactionsPostWithAddrs: (NSString*) addrs + confirmed: (NSString*) confirmed + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/transactions"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (addrs != nil) { + queryParams[@"addrs"] = addrs; + } + if (confirmed != nil) { + queryParams[@"confirmed"] = confirmed; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// Returns an unspent output by ID. +/// +/// @param uxid uxid to filter by (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) uxoutWithUxid: (NSString*) uxid + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/uxout"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (uxid != nil) { + queryParams[@"uxid"] = uxid; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// Verifies a Skycoin address. +/// +/// @param address Address id. +/// +/// @returns OAIInlineResponse2007* +/// +-(NSURLSessionTask*) verifyAddressWithAddress: (NSString*) address + completionHandler: (void (^)(OAIInlineResponse2007* output, NSError* error)) handler { + // verify the required parameter 'address' is set + if (address == nil) { + NSParameterAssert(address); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"address"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v2/address/verify"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (address != nil) { + queryParams[@"address"] = address; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"OAIInlineResponse2007*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((OAIInlineResponse2007*)data, error); + } + }]; +} + +/// +/// +/// versionHandler returns the application version info +/// @returns void +/// +-(NSURLSessionTask*) versionWithCompletionHandler: + (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/version"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Returns a wallet by id. +/// +/// @param _id tags to filter by +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletWithId: (NSString*) _id + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter '_id' is set + if (_id == nil) { + NSParameterAssert(_id); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"_id"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (_id != nil) { + queryParams[@"id"] = _id; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// 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 +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletBalanceWithId: (NSString*) _id + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter '_id' is set + if (_id == nil) { + NSParameterAssert(_id); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"_id"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet/balance"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (_id != nil) { + queryParams[@"id"] = _id; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// 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. (optional) +/// +/// @param encrypt Encrypt wallet. (optional) +/// +/// @param password Wallet Password (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletCreateWithSeed: (NSString*) seed + label: (NSString*) label + scan: (NSNumber*) scan + encrypt: (NSNumber*) encrypt + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter 'seed' is set + if (seed == nil) { + NSParameterAssert(seed); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"seed"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + // verify the required parameter 'label' is set + if (label == nil) { + NSParameterAssert(label); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"label"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet/create"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + if (seed != nil) { + headerParams[@"seed"] = seed; + } + if (label != nil) { + headerParams[@"label"] = label; + } + if (scan != nil) { + headerParams[@"scan"] = scan; + } + if (encrypt != nil) { + headerParams[@"encrypt"] = encrypt; + } + if (password != nil) { + headerParams[@"password"] = password; + } + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// Decrypts wallet. +/// +/// @param _id Wallet id. +/// +/// @param password Wallet password. +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletDecryptWithId: (NSString*) _id + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter '_id' is set + if (_id == nil) { + NSParameterAssert(_id); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"_id"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + // verify the required parameter 'password' is set + if (password == nil) { + NSParameterAssert(password); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"password"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet/decrypt"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + if (_id != nil) { + headerParams[@"id"] = _id; + } + if (password != nil) { + headerParams[@"password"] = password; + } + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// Encrypt wallet. +/// +/// @param _id Wallet id. +/// +/// @param password Wallet password. +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletEncryptWithId: (NSString*) _id + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter '_id' is set + if (_id == nil) { + NSParameterAssert(_id); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"_id"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + // verify the required parameter 'password' is set + if (password == nil) { + NSParameterAssert(password); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"password"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet/encrypt"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + if (_id != nil) { + headerParams[@"id"] = _id; + } + if (password != nil) { + headerParams[@"password"] = password; + } + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// Returns the wallet directory path +/// @param addr Address port +/// +/// @returns OAIInlineResponse2006* +/// +-(NSURLSessionTask*) walletFolderWithAddr: (NSString*) addr + completionHandler: (void (^)(OAIInlineResponse2006* output, NSError* error)) handler { + // verify the required parameter 'addr' is set + if (addr == nil) { + NSParameterAssert(addr); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"addr"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallets/folderName"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (addr != nil) { + queryParams[@"addr"] = addr; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"OAIInlineResponse2006*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((OAIInlineResponse2006*)data, error); + } + }]; +} + +/// +/// +/// Generates new addresses +/// @param _id Wallet Id +/// +/// @param num The number you want to generate (optional) +/// +/// @param password Wallet Password (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletNewAddressWithId: (NSString*) _id + num: (NSString*) num + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter '_id' is set + if (_id == nil) { + NSParameterAssert(_id); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"_id"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet/newAddress"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (_id != nil) { + queryParams[@"id"] = _id; + } + if (num != nil) { + queryParams[@"num"] = num; + } + if (password != nil) { + queryParams[@"password"] = password; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// Returns the wallet directory path +/// @param entropy Entropy bitSize. (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletNewSeedWithEntropy: (NSString*) entropy + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet/newSeed"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (entropy != nil) { + queryParams[@"entropy"] = entropy; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// 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. (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletRecoverWithId: (NSString*) _id + seed: (NSString*) seed + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter '_id' is set + if (_id == nil) { + NSParameterAssert(_id); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"_id"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + // verify the required parameter 'seed' is set + if (seed == nil) { + NSParameterAssert(seed); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"seed"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v2/wallet/recover"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + if (_id != nil) { + headerParams[@"id"] = _id; + } + if (seed != nil) { + headerParams[@"seed"] = seed; + } + if (password != nil) { + headerParams[@"password"] = password; + } + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// 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. +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletSeedWithId: (NSString*) _id + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter '_id' is set + if (_id == nil) { + NSParameterAssert(_id); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"_id"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + // verify the required parameter 'password' is set + if (password == nil) { + NSParameterAssert(password); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"password"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet/seed"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (_id != nil) { + queryParams[@"id"] = _id; + } + if (password != nil) { + queryParams[@"password"] = password; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// Verifies a wallet seed. +/// +/// @param seed Seed to be verified. (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletSeedVerifyWithSeed: (NSString*) seed + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v2/wallet/seed/verify"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + if (seed != nil) { + headerParams[@"seed"] = seed; + } + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// 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. +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletSpentWithId: (NSString*) _id + dst: (NSString*) dst + coins: (NSString*) coins + password: (NSString*) password + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter '_id' is set + if (_id == nil) { + NSParameterAssert(_id); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"_id"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + // verify the required parameter 'dst' is set + if (dst == nil) { + NSParameterAssert(dst); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"dst"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + // verify the required parameter 'coins' is set + if (coins == nil) { + NSParameterAssert(coins); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"coins"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + // verify the required parameter 'password' is set + if (password == nil) { + NSParameterAssert(password); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"password"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet/spend"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + if (_id != nil) { + headerParams[@"id"] = _id; + } + if (dst != nil) { + headerParams[@"dst"] = dst; + } + if (coins != nil) { + headerParams[@"coins"] = coins; + } + if (password != nil) { + headerParams[@"password"] = password; + } + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// Creates a signed transaction +/// @param inlineObject (optional) +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletTransactionWithInlineObject: (OAIInlineObject*) inlineObject + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet/transaction"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = inlineObject; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// +/// Returns returns all unconfirmed transactions for all addresses in a given wallet verbose +/// @param _id Wallet id. +/// +/// @returns NSObject* +/// +-(NSURLSessionTask*) walletTransactionsWithId: (NSString*) _id + completionHandler: (void (^)(NSObject* output, NSError* error)) handler { + // verify the required parameter '_id' is set + if (_id == nil) { + NSParameterAssert(_id); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"_id"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet/transactions"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (_id != nil) { + queryParams[@"id"] = _id; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSObject*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSObject*)data, error); + } + }]; +} + +/// +/// Unloads wallet from the wallet service. +/// +/// @param _id Wallet Id. +/// +/// @returns void +/// +-(NSURLSessionTask*) walletUnloadWithId: (NSString*) _id + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter '_id' is set + if (_id == nil) { + NSParameterAssert(_id); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"_id"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet/unload"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (_id != nil) { + queryParams[@"id"] = _id; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Update the wallet. +/// +/// @param _id Wallet Id. +/// +/// @param label The label the wallet will be updated to. +/// +/// @returns void +/// +-(NSURLSessionTask*) walletUpdateWithId: (NSString*) _id + label: (NSString*) label + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter '_id' is set + if (_id == nil) { + NSParameterAssert(_id); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"_id"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + // verify the required parameter 'label' is set + if (label == nil) { + NSParameterAssert(label); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"label"] }; + NSError* error = [NSError errorWithDomain:kOAIDefaultApiErrorDomain code:kOAIDefaultApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallet/update"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + if (_id != nil) { + headerParams[@"id"] = _id; + } + if (label != nil) { + headerParams[@"label"] = label; + } + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"csrfAuth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// +/// Returns all loaded wallets +/// @returns NSArray* +/// +-(NSURLSessionTask*) walletsWithCompletionHandler: + (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/api/v1/wallets"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + + + +@end diff --git a/lib/skyapi/skyapi/Core/JSONValueTransformer+ISO8601.h b/lib/skyapi/skyapi/Core/JSONValueTransformer+ISO8601.h new file mode 100644 index 0000000..0f55d82 --- /dev/null +++ b/lib/skyapi/skyapi/Core/JSONValueTransformer+ISO8601.h @@ -0,0 +1,19 @@ +#import +#import + +/** +* 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. +*/ + + +@interface JSONValueTransformer (ISO8601) + +@end diff --git a/lib/skyapi/skyapi/Core/JSONValueTransformer+ISO8601.m b/lib/skyapi/skyapi/Core/JSONValueTransformer+ISO8601.m new file mode 100644 index 0000000..61ae254 --- /dev/null +++ b/lib/skyapi/skyapi/Core/JSONValueTransformer+ISO8601.m @@ -0,0 +1,17 @@ +#import +#import "JSONValueTransformer+ISO8601.h" +#import "OAISanitizer.h" + +@implementation JSONValueTransformer (ISO8601) + +- (NSDate *) NSDateFromNSString:(NSString *)string +{ + return [NSDate dateWithISO8601String:string]; +} + +- (NSString *)JSONObjectFromNSDate:(NSDate *)date +{ + return [OAISanitizer dateToString:date]; +} + +@end diff --git a/lib/skyapi/skyapi/Core/OAIApi.h b/lib/skyapi/skyapi/Core/OAIApi.h new file mode 100644 index 0000000..63c1201 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIApi.h @@ -0,0 +1,29 @@ +#import + +@class OAIApiClient; + +/** +* 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. +*/ + + +@protocol OAIApi + +@property(readonly, nonatomic, strong) OAIApiClient *apiClient; + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient; + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; +-(NSString*) defaultHeaderForKey:(NSString*)key; + +-(NSDictionary *)defaultHeaders; + +@end diff --git a/lib/skyapi/skyapi/Core/OAIApiClient.h b/lib/skyapi/skyapi/Core/OAIApiClient.h new file mode 100644 index 0000000..86a50eb --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIApiClient.h @@ -0,0 +1,121 @@ +#import +#import "OAIConfiguration.h" +#import "OAIResponseDeserializer.h" +#import "OAISanitizer.h" + +/** +* 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. +*/ + + +/** + * A key for `NSError` user info dictionaries. + * + * The corresponding value is the parsed response body for an HTTP error. + */ +extern NSString *const OAIResponseObjectErrorKey; + + +@interface OAIApiClient : AFHTTPSessionManager + +@property (nonatomic, strong, readonly) id configuration; + +@property(nonatomic, assign) NSTimeInterval timeoutInterval; + +@property(nonatomic, strong) id responseDeserializer; + +@property(nonatomic, strong) id sanitizer; + +/** + * Gets if the client is unreachable + * + * @return The client offline state + */ ++(BOOL) getOfflineState; + +/** + * Sets the client reachability, this may be overridden by the reachability manager if reachability changes + * + * @param status The client reachability status. + */ ++(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; + +/** + * Gets the client reachability + * + * @return The client reachability. + */ ++(AFNetworkReachabilityStatus) getReachabilityStatus; + +@property (nonatomic, strong) NSDictionary< NSString *, AFHTTPRequestSerializer *>* requestSerializerForContentType; + +/** + * Gets client singleton instance + */ ++ (instancetype) sharedClient; + + +/** + * Updates header parameters and query parameters for authentication + * + * @param headers The header parameter will be updated, passed by pointer to pointer. + * @param querys The query parameters will be updated, passed by pointer to pointer. + * @param authSettings The authentication names NSArray. + */ +- (void) updateHeaderParams:(NSDictionary **)headers queryParams:(NSDictionary **)querys WithAuthSettings:(NSArray *)authSettings; + + +/** + * Initializes the session manager with a configuration. + * + * @param configuration The configuration implementation + */ +- (instancetype)initWithConfiguration:(id)configuration; + +/** +* Initializes the session manager with a configuration and url +* +* @param url The base url +* @param configuration The configuration implementation +*/ +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration; + +/** + * Performs request + * + * @param path Request url. + * @param method Request method. + * @param pathParams Request path parameters. + * @param queryParams Request query parameters. + * @param body Request body. + * @param headerParams Request header parameters. + * @param authSettings Request authentication names. + * @param requestContentType Request content-type. + * @param responseContentType Response content-type. + * @param completionBlock The block will be executed when the request completed. + * + * @return The created session task. + */ +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock; + +@end diff --git a/lib/skyapi/skyapi/Core/OAIApiClient.m b/lib/skyapi/skyapi/Core/OAIApiClient.m new file mode 100644 index 0000000..bcbd477 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIApiClient.m @@ -0,0 +1,376 @@ + +#import "OAILogger.h" +#import "OAIApiClient.h" +#import "OAIJSONRequestSerializer.h" +#import "OAIQueryParamCollection.h" +#import "OAIDefaultConfiguration.h" + +NSString *const OAIResponseObjectErrorKey = @"OAIResponseObject"; + +static NSString * const kOAIContentDispositionKey = @"Content-Disposition"; + +static NSDictionary * OAI__headerFieldsForResponse(NSURLResponse *response) { + if(![response isKindOfClass:[NSHTTPURLResponse class]]) { + return nil; + } + return ((NSHTTPURLResponse*)response).allHeaderFields; +} + +static NSString * OAI__fileNameForResponse(NSURLResponse *response) { + NSDictionary * headers = OAI__headerFieldsForResponse(response); + if(!headers[kOAIContentDispositionKey]) { + return [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]]; + } + NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?"; + NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil]; + NSString *contentDispositionHeader = headers[kOAIContentDispositionKey]; + NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader options:0 range:NSMakeRange(0, [contentDispositionHeader length])]; + return [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]]; +} + + +@interface OAIApiClient () + +@property (nonatomic, strong, readwrite) id configuration; + +@property (nonatomic, strong) NSArray* downloadTaskResponseTypes; + +@end + +@implementation OAIApiClient + +#pragma mark - Singleton Methods + ++ (instancetype) sharedClient { + static OAIApiClient *sharedClient = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedClient = [[self alloc] init]; + }); + return sharedClient; +} + +#pragma mark - Initialize Methods + +- (instancetype)init { + return [self initWithConfiguration:[OAIDefaultConfiguration sharedConfig]]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url { + return [self initWithBaseURL:url configuration:[OAIDefaultConfiguration sharedConfig]]; +} + +- (instancetype)initWithConfiguration:(id)configuration { + return [self initWithBaseURL:[NSURL URLWithString:configuration.host] configuration:configuration]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration { + self = [super initWithBaseURL:url]; + if (self) { + _configuration = configuration; + _timeoutInterval = 60; + _responseDeserializer = [[OAIResponseDeserializer alloc] init]; + _sanitizer = [[OAISanitizer alloc] init]; + + _downloadTaskResponseTypes = @[@"NSURL*", @"NSURL"]; + + AFHTTPRequestSerializer* afhttpRequestSerializer = [AFHTTPRequestSerializer serializer]; + OAIJSONRequestSerializer * swgjsonRequestSerializer = [OAIJSONRequestSerializer serializer]; + _requestSerializerForContentType = @{kOAIApplicationJSONType : swgjsonRequestSerializer, + @"application/x-www-form-urlencoded": afhttpRequestSerializer, + @"multipart/form-data": afhttpRequestSerializer + }; + self.securityPolicy = [self createSecurityPolicy]; + self.responseSerializer = [AFHTTPResponseSerializer serializer]; + } + return self; +} + +#pragma mark - Task Methods + +- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { + + NSURLSessionDataTask *task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { + OAIDebugLogResponse(response, responseObject,request,error); + if(!error) { + completionBlock(responseObject, nil); + return; + } + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; + if (responseObject) { + // Add in the (parsed) response body. + userInfo[OAIResponseObjectErrorKey] = responseObject; + } + NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; + completionBlock(nil, augmentedError); + }]; + + return task; +} + +- (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { + + __block NSString * tempFolderPath = [self.configuration.tempFolderPath copy]; + + NSURLSessionDataTask* task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { + OAIDebugLogResponse(response, responseObject,request,error); + + if(error) { + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; + if (responseObject) { + userInfo[OAIResponseObjectErrorKey] = responseObject; + } + NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; + completionBlock(nil, augmentedError); + return; + } + + NSString *directory = tempFolderPath ?: NSTemporaryDirectory(); + NSString *filename = OAI__fileNameForResponse(response); + + NSString *filepath = [directory stringByAppendingPathComponent:filename]; + NSURL *file = [NSURL fileURLWithPath:filepath]; + + [responseObject writeToURL:file atomically:YES]; + + completionBlock(file, nil); + }]; + + return task; +} + +#pragma mark - Perform Request Methods + +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock { + + AFHTTPRequestSerializer * requestSerializer = [self requestSerializerForRequestContentType:requestContentType]; + + __weak id sanitizer = self.sanitizer; + + // sanitize parameters + pathParams = [sanitizer sanitizeForSerialization:pathParams]; + queryParams = [sanitizer sanitizeForSerialization:queryParams]; + headerParams = [sanitizer sanitizeForSerialization:headerParams]; + formParams = [sanitizer sanitizeForSerialization:formParams]; + if(![body isKindOfClass:[NSData class]]) { + body = [sanitizer sanitizeForSerialization:body]; + } + + // auth setting + [self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings]; + + NSMutableString *resourcePath = [NSMutableString stringWithString:path]; + [pathParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSString * safeString = ([obj isKindOfClass:[NSString class]]) ? obj : [NSString stringWithFormat:@"%@", obj]; + safeString = OAIPercentEscapedStringFromString(safeString); + [resourcePath replaceCharactersInRange:[resourcePath rangeOfString:[NSString stringWithFormat:@"{%@}", key]] withString:safeString]; + }]; + + NSString* pathWithQueryParams = [self pathWithQueryParamsToString:resourcePath queryParams:queryParams]; + if ([pathWithQueryParams hasPrefix:@"/"]) { + pathWithQueryParams = [pathWithQueryParams substringFromIndex:1]; + } + + NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString]; + + NSError *requestCreateError = nil; + NSMutableURLRequest * request = nil; + if (files.count > 0) { + request = [requestSerializer multipartFormRequestWithMethod:@"POST" URLString:urlString parameters:nil constructingBodyWithBlock:^(id formData) { + [formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSString *objString = [sanitizer parameterToString:obj]; + NSData *data = [objString dataUsingEncoding:NSUTF8StringEncoding]; + [formData appendPartWithFormData:data name:key]; + }]; + [files enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSURL *filePath = (NSURL *)obj; + [formData appendPartWithFileURL:filePath name:key error:nil]; + }]; + } error:&requestCreateError]; + } + else { + if (formParams) { + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:formParams error:&requestCreateError]; + } + if (body) { + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:body error:&requestCreateError]; + } + } + if(!request) { + completionBlock(nil, requestCreateError); + return nil; + } + + if ([headerParams count] > 0){ + for(NSString * key in [headerParams keyEnumerator]){ + [request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key]; + } + } + [requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"]; + + [self postProcessRequest:request]; + + + NSURLSessionTask *task = nil; + + if ([self.downloadTaskResponseTypes containsObject:responseType]) { + task = [self downloadTaskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { + completionBlock(data, error); + }]; + } else { + __weak typeof(self) weakSelf = self; + task = [self taskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { + NSError * serializationError; + id response = [weakSelf.responseDeserializer deserialize:data class:responseType error:&serializationError]; + + if(!response && !error){ + error = serializationError; + } + completionBlock(response, error); + }]; + } + + [task resume]; + + return task; +} + +-(AFHTTPRequestSerializer *)requestSerializerForRequestContentType:(NSString *)requestContentType { + AFHTTPRequestSerializer * serializer = self.requestSerializerForContentType[requestContentType]; + if(!serializer) { + NSAssert(NO, @"Unsupported request content type %@", requestContentType); + serializer = [AFHTTPRequestSerializer serializer]; + } + serializer.timeoutInterval = self.timeoutInterval; + return serializer; +} + +//Added for easier override to modify request +-(void)postProcessRequest:(NSMutableURLRequest *)request { + +} + +#pragma mark - + +- (NSString*) pathWithQueryParamsToString:(NSString*) path queryParams:(NSDictionary*) queryParams { + if(queryParams.count == 0) { + return path; + } + NSString * separator = nil; + NSUInteger counter = 0; + + NSMutableString * requestUrl = [NSMutableString stringWithFormat:@"%@", path]; + + NSDictionary *separatorStyles = @{@"csv" : @",", + @"tsv" : @"\t", + @"pipes": @"|" + }; + for(NSString * key in [queryParams keyEnumerator]){ + if (counter == 0) { + separator = @"?"; + } else { + separator = @"&"; + } + id queryParam = [queryParams valueForKey:key]; + if(!queryParam) { + continue; + } + NSString *safeKey = OAIPercentEscapedStringFromString(key); + if ([queryParam isKindOfClass:[NSString class]]){ + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, OAIPercentEscapedStringFromString(queryParam)]]; + + } else if ([queryParam isKindOfClass:[OAIQueryParamCollection class]]){ + OAIQueryParamCollection * coll = (OAIQueryParamCollection*) queryParam; + NSArray* values = [coll values]; + NSString* format = [coll format]; + + if([format isEqualToString:@"multi"]) { + for(id obj in values) { + if (counter > 0) { + separator = @"&"; + } + NSString * safeValue = OAIPercentEscapedStringFromString([NSString stringWithFormat:@"%@",obj]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + counter += 1; + } + continue; + } + NSString * separatorStyle = separatorStyles[format]; + NSString * safeValue = OAIPercentEscapedStringFromString([values componentsJoinedByString:separatorStyle]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + } else { + NSString * safeValue = OAIPercentEscapedStringFromString([NSString stringWithFormat:@"%@",queryParam]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + } + counter += 1; + } + return requestUrl; +} + +/** + * Update header and query params based on authentication settings + */ +- (void) updateHeaderParams:(NSDictionary * *)headers queryParams:(NSDictionary * *)querys WithAuthSettings:(NSArray *)authSettings { + + if ([authSettings count] == 0) { + return; + } + + NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; + NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; + + id config = self.configuration; + for (NSString *auth in authSettings) { + NSDictionary *authSetting = config.authSettings[auth]; + + if(!authSetting) { // auth setting is set only if the key is non-empty + continue; + } + NSString *type = authSetting[@"in"]; + NSString *key = authSetting[@"key"]; + NSString *value = authSetting[@"value"]; + if ([type isEqualToString:@"header"] && [key length] > 0 ) { + headersWithAuth[key] = value; + } else if ([type isEqualToString:@"query"] && [key length] != 0) { + querysWithAuth[key] = value; + } + } + + *headers = [NSDictionary dictionaryWithDictionary:headersWithAuth]; + *querys = [NSDictionary dictionaryWithDictionary:querysWithAuth]; +} + +- (AFSecurityPolicy *) createSecurityPolicy { + AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; + + id config = self.configuration; + + if (config.sslCaCert) { + NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; + [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; + } + + if (config.verifySSL) { + [securityPolicy setAllowInvalidCertificates:NO]; + } + else { + [securityPolicy setAllowInvalidCertificates:YES]; + [securityPolicy setValidatesDomainName:NO]; + } + + return securityPolicy; +} + +@end diff --git a/lib/skyapi/skyapi/Core/OAIBasicAuthTokenProvider.h b/lib/skyapi/skyapi/Core/OAIBasicAuthTokenProvider.h new file mode 100644 index 0000000..b67a390 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIBasicAuthTokenProvider.h @@ -0,0 +1,14 @@ +/** The `OAIBasicAuthTokenProvider` class creates a basic auth token from username and password. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#import + +@interface OAIBasicAuthTokenProvider : NSObject + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password; + +@end \ No newline at end of file diff --git a/lib/skyapi/skyapi/Core/OAIBasicAuthTokenProvider.m b/lib/skyapi/skyapi/Core/OAIBasicAuthTokenProvider.m new file mode 100644 index 0000000..70afc93 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIBasicAuthTokenProvider.m @@ -0,0 +1,19 @@ +#import "OAIBasicAuthTokenProvider.h" + +@implementation OAIBasicAuthTokenProvider + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password { + + // return empty string if username and password are empty + if (username.length == 0 && password.length == 0){ + return @""; + } + + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password]; + NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; + basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; + + return basicAuthCredentials; +} + +@end diff --git a/lib/skyapi/skyapi/Core/OAIConfiguration.h b/lib/skyapi/skyapi/Core/OAIConfiguration.h new file mode 100644 index 0000000..81dd1ad --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIConfiguration.h @@ -0,0 +1,89 @@ +#import + +@class OAILogger; + +/** +* 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. +*/ + + +static NSString * const kOAIAPIVersion = @"v0.25.1"; + +@protocol OAIConfiguration + +/** + * Api logger + */ +@property (readonly, nonatomic) OAILogger *logger; + +/** + * Base url + */ +@property (readonly, nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + */ +@property (readonly, nonatomic) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + */ +@property (readonly, nonatomic) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ +@property (readonly, nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (readonly, nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (readonly, nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (readonly, nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (readonly, nonatomic) BOOL debug; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (readonly, nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (readonly, nonatomic) NSString *sslCaCert; + +/** + * Authentication Settings + */ +@property (readonly, nonatomic) NSDictionary *authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +@end diff --git a/lib/skyapi/skyapi/Core/OAIDefaultConfiguration.h b/lib/skyapi/skyapi/Core/OAIDefaultConfiguration.h new file mode 100644 index 0000000..e0afef9 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIDefaultConfiguration.h @@ -0,0 +1,171 @@ +#import +#import "OAIConfiguration.h" + +/** +* 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. +*/ + + +@class OAIApiClient; + +@interface OAIDefaultConfiguration : NSObject + + +/** + * Default api logger + */ +@property (nonatomic, strong) OAILogger * logger; + +/** + * Default base url + */ +@property (nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + * + * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + * + * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ + @property (nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (nonatomic) BOOL debug; + +/** + * Gets configuration singleton instance + */ ++ (instancetype) sharedConfig; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (nonatomic) NSString *sslCaCert; + +/** + * The time zone to use for date serialization + */ +@property (nonatomic) NSTimeZone *serializationTimeZone; + +/** + * Sets API key + * + * To remove an apiKey for an identifier, just set the apiKey to nil. + * + * @param apiKey API key or token. + * @param identifier API key identifier (authentication schema). + * + */ +- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; + +/** + * Removes api key + * + * @param identifier API key identifier. + */ +- (void) removeApiKey:(NSString *)identifier; + +/** + * Sets the prefix for API key + * + * @param prefix API key prefix. + * @param identifier API key identifier. + */ +- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; + +/** + * Removes api key prefix + * + * @param identifier API key identifier. + */ +- (void) removeApiKeyPrefix:(NSString *)identifier; + +/** + * Gets API key (with prefix if set) + */ +- (NSString *) getApiKeyWithPrefix:(NSString *) key; + +/** + * Gets Basic Auth token + */ +- (NSString *) getBasicAuthToken; + +/** + * Gets OAuth access token + */ +- (NSString *) getAccessToken; + +/** + * Gets Authentication Settings + */ +- (NSDictionary *) authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +/** +* Removes header from defaultHeaders +* +* @param key Header name. +*/ +-(void) removeDefaultHeaderForKey:(NSString*)key; + +/** +* Sets the header for key +* +* @param value Value for header name +* @param key Header name +*/ +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; + +/** +* @param key Header key name. +*/ +-(NSString*) defaultHeaderForKey:(NSString*)key; + +@end diff --git a/lib/skyapi/skyapi/Core/OAIDefaultConfiguration.m b/lib/skyapi/skyapi/Core/OAIDefaultConfiguration.m new file mode 100644 index 0000000..c0a1d64 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIDefaultConfiguration.m @@ -0,0 +1,145 @@ +#import "OAIDefaultConfiguration.h" +#import "OAIBasicAuthTokenProvider.h" +#import "OAILogger.h" + +@interface OAIDefaultConfiguration () + +@property (nonatomic, strong) NSMutableDictionary *mutableDefaultHeaders; +@property (nonatomic, strong) NSMutableDictionary *mutableApiKey; +@property (nonatomic, strong) NSMutableDictionary *mutableApiKeyPrefix; + +@end + +@implementation OAIDefaultConfiguration + +#pragma mark - Singleton Methods + ++ (instancetype) sharedConfig { + static OAIDefaultConfiguration *shardConfig = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + shardConfig = [[self alloc] init]; + }); + return shardConfig; +} + +#pragma mark - Initialize Methods + +- (instancetype) init { + self = [super init]; + if (self) { + _host = @"http://127.0.0.1:6420"; + _username = @""; + _password = @""; + _accessToken= @""; + _verifySSL = YES; + _mutableApiKey = [NSMutableDictionary dictionary]; + _mutableApiKeyPrefix = [NSMutableDictionary dictionary]; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + + _logger = [OAILogger sharedLogger]; + } + return self; +} + +#pragma mark - Instance Methods + +- (NSString *) getApiKeyWithPrefix:(NSString *)key { + NSString *prefix = self.apiKeyPrefix[key]; + NSString *apiKey = self.apiKey[key]; + if (prefix && apiKey != (id)[NSNull null] && apiKey.length > 0) { // both api key prefix and api key are set + return [NSString stringWithFormat:@"%@ %@", prefix, apiKey]; + } + else if (apiKey != (id)[NSNull null] && apiKey.length > 0) { // only api key, no api key prefix + return [NSString stringWithFormat:@"%@", self.apiKey[key]]; + } + else { // return empty string if nothing is set + return @""; + } +} + +- (NSString *) getBasicAuthToken { + + NSString *basicAuthToken = [OAIBasicAuthTokenProvider createBasicAuthTokenWithUsername:self.username password:self.password]; + return basicAuthToken; +} + +- (NSString *) getAccessToken { + if (self.accessToken.length == 0) { // token not set, return empty string + return @""; + } else { + return [NSString stringWithFormat:@"Bearer %@", self.accessToken]; + } +} + +#pragma mark - Setter Methods + +- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString *)identifier { + [self.mutableApiKey setValue:apiKey forKey:identifier]; +} + +- (void) removeApiKey:(NSString *)identifier { + [self.mutableApiKey removeObjectForKey:identifier]; +} + +- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier { + [self.mutableApiKeyPrefix setValue:prefix forKey:identifier]; +} + +- (void) removeApiKeyPrefix:(NSString *)identifier { + [self.mutableApiKeyPrefix removeObjectForKey:identifier]; +} + +#pragma mark - Getter Methods + +- (NSDictionary *) apiKey { + return [NSDictionary dictionaryWithDictionary:self.mutableApiKey]; +} + +- (NSDictionary *) apiKeyPrefix { + return [NSDictionary dictionaryWithDictionary:self.mutableApiKeyPrefix]; +} + +#pragma mark - + +- (NSDictionary *) authSettings { + return @{ + @"csrfAuth": + @{ + @"type": @"api_key", + @"in": @"header", + @"key": @"X-CSRF-TOKEN", + @"value": [self getApiKeyWithPrefix:@"X-CSRF-TOKEN"] + }, + }; +} + +-(BOOL)debug { + return self.logger.isEnabled; +} + +-(void)setDebug:(BOOL)debug { + self.logger.enabled = debug; +} + +- (void)setDefaultHeaderValue:(NSString *)value forKey:(NSString *)key { + if(!value) { + [self.mutableDefaultHeaders removeObjectForKey:key]; + return; + } + self.mutableDefaultHeaders[key] = value; +} + +-(void) removeDefaultHeaderForKey:(NSString*)key { + [self.mutableDefaultHeaders removeObjectForKey:key]; +} + +- (NSString *)defaultHeaderForKey:(NSString *)key { + return self.mutableDefaultHeaders[key]; +} + +- (NSDictionary *)defaultHeaders { + return [self.mutableDefaultHeaders copy]; +} + +@end diff --git a/lib/skyapi/skyapi/Core/OAIJSONRequestSerializer.h b/lib/skyapi/skyapi/Core/OAIJSONRequestSerializer.h new file mode 100644 index 0000000..72bf9a8 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIJSONRequestSerializer.h @@ -0,0 +1,18 @@ +#import +#import + +/** +* 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. +*/ + + +@interface OAIJSONRequestSerializer : AFJSONRequestSerializer +@end diff --git a/lib/skyapi/skyapi/Core/OAIJSONRequestSerializer.m b/lib/skyapi/skyapi/Core/OAIJSONRequestSerializer.m new file mode 100644 index 0000000..644f07c --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIJSONRequestSerializer.m @@ -0,0 +1,37 @@ +#import "OAIJSONRequestSerializer.h" + +@implementation OAIJSONRequestSerializer + +/// +/// When customize a request serializer, +/// the serializer must conform the protocol `AFURLRequestSerialization` +/// and implements the protocol method `requestBySerializingRequest:withParameters:error:` +/// +/// @param request The original request. +/// @param parameters The parameters to be encoded. +/// @param error The error that occurred while attempting to encode the request parameters. +/// +/// @return A serialized request. +/// +- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + if (!parameters) { + return request; + } + // If the body data which will be serialized isn't NSArray or NSDictionary + // then put the data in the http request body directly. + if ([parameters isKindOfClass:[NSArray class]] || [parameters isKindOfClass:[NSDictionary class]]) { + return [super requestBySerializingRequest:request withParameters:parameters error:error]; + } + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + if([parameters isKindOfClass:[NSData class]]) { + [mutableRequest setHTTPBody:parameters]; + } else { + [mutableRequest setHTTPBody:[parameters dataUsingEncoding:self.stringEncoding]]; + } + return mutableRequest; +} + +@end diff --git a/lib/skyapi/skyapi/Core/OAILogger.h b/lib/skyapi/skyapi/Core/OAILogger.h new file mode 100644 index 0000000..50cb19c --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAILogger.h @@ -0,0 +1,61 @@ +#import + +/** +* 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. +*/ + + +#ifndef OAIDebugLogResponse +#define OAIDebugLogResponse(response, responseObject,request, error) [[OAILogger sharedLogger] logResponse:response responseObject:responseObject request:request error:error]; +#endif + +/** + * Log debug message macro + */ +#ifndef OAIDebugLog +#define OAIDebugLog(format, ...) [[OAILogger sharedLogger] debugLog:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__] message: format, ##__VA_ARGS__]; +#endif + +@interface OAILogger : NSObject + ++(instancetype)sharedLogger; + +/** + * Enabled switch, default NO - default set by OAIConfiguration debug property + */ +@property (nonatomic, assign, getter=isEnabled) BOOL enabled; + +/** + * Debug file location, default log in console + */ +@property (nonatomic, strong) NSString *loggingFile; + +/** + * Log file handler, this property is used by sdk internally. + */ +@property (nonatomic, strong, readonly) NSFileHandle *loggingFileHandler; + +/** + * Log debug message + */ +-(void)debugLog:(NSString *)method message:(NSString *)format, ...; + +/** + * Logs request and response + * + * @param response NSURLResponse for the HTTP request. + * @param responseObject response object of the HTTP request. + * @param request The HTTP request. + * @param error The error of the HTTP request. + */ +- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error; + +@end diff --git a/lib/skyapi/skyapi/Core/OAILogger.m b/lib/skyapi/skyapi/Core/OAILogger.m new file mode 100644 index 0000000..42b9506 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAILogger.m @@ -0,0 +1,73 @@ +#import "OAILogger.h" + +@interface OAILogger () + +@end + +@implementation OAILogger + ++ (instancetype) sharedLogger { + static OAILogger *shardLogger = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + shardLogger = [[self alloc] init]; + }); + return shardLogger; +} + +#pragma mark - Log Methods + +- (void)debugLog:(NSString *)method message:(NSString *)format, ... { + if (!self.isEnabled) { + return; + } + + NSMutableString *message = [NSMutableString stringWithCapacity:1]; + + if (method) { + [message appendFormat:@"%@: ", method]; + } + + va_list args; + va_start(args, format); + + [message appendString:[[NSString alloc] initWithFormat:format arguments:args]]; + + // If set logging file handler, log into file, + // otherwise log into console. + if (self.loggingFileHandler) { + [self.loggingFileHandler seekToEndOfFile]; + [self.loggingFileHandler writeData:[message dataUsingEncoding:NSUTF8StringEncoding]]; + } else { + NSLog(@"%@", message); + } + + va_end(args); +} + +- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error { + NSString *message = [NSString stringWithFormat:@"\n[DEBUG] HTTP request body \n~BEGIN~\n %@\n~END~\n"\ + "[DEBUG] HTTP response body \n~BEGIN~\n %@\n~END~\n", + [[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding], + responseObject]; + + OAIDebugLog(message); +} + +- (void) setLoggingFile:(NSString *)loggingFile { + if(_loggingFile == loggingFile) { + return; + } + // close old file handler + if ([self.loggingFileHandler isKindOfClass:[NSFileHandle class]]) { + [self.loggingFileHandler closeFile]; + } + _loggingFile = loggingFile; + _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; + if (_loggingFileHandler == nil) { + [[NSFileManager defaultManager] createFileAtPath:_loggingFile contents:nil attributes:nil]; + _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; + } +} + +@end diff --git a/lib/skyapi/skyapi/Core/OAIObject.h b/lib/skyapi/skyapi/Core/OAIObject.h new file mode 100644 index 0000000..d6952b4 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIObject.h @@ -0,0 +1,19 @@ +#import +#import + +/** +* 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. +*/ + + +@interface OAIObject : JSONModel + +@end diff --git a/lib/skyapi/skyapi/Core/OAIObject.m b/lib/skyapi/skyapi/Core/OAIObject.m new file mode 100644 index 0000000..fd31d41 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIObject.m @@ -0,0 +1,42 @@ +#import "OAIObject.h" + +@implementation OAIObject + +/** + * Workaround for JSONModel multithreading issues + * https://github.com/icanzilb/JSONModel/issues/441 + */ +- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)err { + static NSMutableSet *classNames; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + classNames = [NSMutableSet new]; + }); + + BOOL initSync; + @synchronized([self class]) + { + NSString *className = NSStringFromClass([self class]); + initSync = ![classNames containsObject:className]; + if(initSync) + { + [classNames addObject:className]; + self = [super initWithDictionary:dict error:err]; + } + } + if(!initSync) + { + self = [super initWithDictionary:dict error:err]; + } + return self; +} + +/** + * Gets the string presentation of the object. + * This method will be called when logging model object using `NSLog`. + */ +- (NSString *)description { + return [[self toDictionary] description]; +} + +@end diff --git a/lib/skyapi/skyapi/Core/OAIQueryParamCollection.h b/lib/skyapi/skyapi/Core/OAIQueryParamCollection.h new file mode 100644 index 0000000..ce3a2c9 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIQueryParamCollection.h @@ -0,0 +1,24 @@ +#import + +/** +* 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. +*/ + + +@interface OAIQueryParamCollection : NSObject + +@property(nonatomic, readonly) NSArray* values; +@property(nonatomic, readonly) NSString* format; + +- (id) initWithValuesAndFormat: (NSArray*) values + format: (NSString*) format; + +@end diff --git a/lib/skyapi/skyapi/Core/OAIQueryParamCollection.m b/lib/skyapi/skyapi/Core/OAIQueryParamCollection.m new file mode 100644 index 0000000..fba3967 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIQueryParamCollection.m @@ -0,0 +1,20 @@ +#import "OAIQueryParamCollection.h" + +@implementation OAIQueryParamCollection + +@synthesize values = _values; +@synthesize format = _format; + +- (id)initWithValuesAndFormat:(NSArray *)values + format:(NSString *)format { + + self = [super init]; + if (self) { + _values = values; + _format = format; + } + + return self; +} + +@end diff --git a/lib/skyapi/skyapi/Core/OAIResponseDeserializer.h b/lib/skyapi/skyapi/Core/OAIResponseDeserializer.h new file mode 100644 index 0000000..fdcbd65 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIResponseDeserializer.h @@ -0,0 +1,57 @@ +#import + +/** +* 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. +*/ + + +/** + * A key for deserialization ErrorDomain + */ +extern NSString *const OAIDeserializationErrorDomainKey; + +/** + * Code for deserialization type mismatch error + */ +extern NSInteger const OAITypeMismatchErrorCode; + +/** + * Code for deserialization empty value error + */ +extern NSInteger const OAIEmptyValueOccurredErrorCode; + +/** + * Error code for unknown response + */ +extern NSInteger const OAIUnknownResponseObjectErrorCode; + +@protocol OAIResponseDeserializer + +/** + * Deserializes the given data to Objective-C object. + * + * @param data The data will be deserialized. + * @param className The type of objective-c object. + * @param error The error + */ +- (id) deserialize:(id) data class:(NSString *) className error:(NSError**)error; + +@end + +@interface OAIResponseDeserializer : NSObject + +/** + * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored + * @default NO + */ +@property (nonatomic, assign) BOOL treatNullAsError; + +@end diff --git a/lib/skyapi/skyapi/Core/OAIResponseDeserializer.m b/lib/skyapi/skyapi/Core/OAIResponseDeserializer.m new file mode 100644 index 0000000..46ffcb2 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAIResponseDeserializer.m @@ -0,0 +1,247 @@ +#import "OAIResponseDeserializer.h" +#import +#import + +NSString *const OAIDeserializationErrorDomainKey = @"OAIDeserializationErrorDomainKey"; + +NSInteger const OAITypeMismatchErrorCode = 143553; + +NSInteger const OAIEmptyValueOccurredErrorCode = 143509; + +NSInteger const OAIUnknownResponseObjectErrorCode = 143528; + + +@interface OAIResponseDeserializer () + +@property (nonatomic, strong) NSNumberFormatter* numberFormatter; +@property (nonatomic, strong) NSArray *primitiveTypes; +@property (nonatomic, strong) NSArray *basicReturnTypes; +@property (nonatomic, strong) NSArray *dataReturnTypes; + +@property (nonatomic, strong) NSRegularExpression* arrayOfModelsPatExpression; +@property (nonatomic, strong) NSRegularExpression* arrayOfPrimitivesPatExpression; +@property (nonatomic, strong) NSRegularExpression* dictPatExpression; +@property (nonatomic, strong) NSRegularExpression* dictModelsPatExpression; + +@end + +@implementation OAIResponseDeserializer + +- (instancetype)init { + self = [super init]; + if (self) { + NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; + formatter.numberStyle = NSNumberFormatterDecimalStyle; + _numberFormatter = formatter; + _primitiveTypes = @[@"NSString", @"NSDate", @"NSNumber"]; + _basicReturnTypes = @[@"NSObject", @"id"]; + _dataReturnTypes = @[@"NSData"]; + + _arrayOfModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray<(.+)>" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _arrayOfPrimitivesPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray\\* /\\* (.+) \\*/" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _dictPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\* /\\* (.+?), (.+) \\*/" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _dictModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\<(.+?), (.+)*\\>" + options:NSRegularExpressionCaseInsensitive + error:nil]; + } + return self; +} + +#pragma mark - Deserialize methods + +- (id) deserialize:(id) data class:(NSString *) className error:(NSError **) error { + if (!data || !className) { + return nil; + } + + if ([className hasSuffix:@"*"]) { + className = [className substringToIndex:[className length] - 1]; + } + if([self.dataReturnTypes containsObject:className]) { + return data; + } + id jsonData = nil; + if([data isKindOfClass:[NSData class]]) { + jsonData = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:error]; + } else { + jsonData = data; + } + if(!jsonData) { + jsonData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + } else if([jsonData isKindOfClass:[NSNull class]]) { + return nil; + } + + // pure object + if ([self.basicReturnTypes containsObject:className]) { + return jsonData; + } + + // primitives + if ([self.primitiveTypes containsObject:className]) { + return [self deserializePrimitiveValue:jsonData class:className error:error]; + } + + NSTextCheckingResult *match = nil; + NSRange range = NSMakeRange(0, [className length]); + // list of models + match = [self.arrayOfModelsPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; + } + + // list of primitives + match = [self.arrayOfPrimitivesPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; + } + + // map + match = [self.dictPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; + } + + match = [self.dictModelsPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; + } + + // model + Class ModelClass = NSClassFromString(className); + if ([ModelClass instancesRespondToSelector:@selector(initWithDictionary:error:)]) { + return [(JSONModel *) [ModelClass alloc] initWithDictionary:jsonData error:error]; + } + + if(error) { + *error = [self unknownResponseErrorWithExpectedType:className data:jsonData]; + } + return nil; +} + +- (id) deserializeDictionaryValue:(id) data valueType:(NSString *) valueType error:(NSError**)error { + if(![data isKindOfClass: [NSDictionary class]]) { + if(error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDictionary class]) data:data]; + } + return nil; + } + __block NSMutableDictionary *resultDict = [NSMutableDictionary dictionaryWithCapacity:[data count]]; + for (id key in [data allKeys]) { + id obj = [data valueForKey:key]; + id dicObj = [self deserialize:obj class:valueType error:error]; + if(dicObj) { + [resultDict setValue:dicObj forKey:key]; + } else if([obj isKindOfClass:[NSNull class]]) { + if(self.treatNullAsError) { + if (error) { + *error = [self emptyValueOccurredError]; + } + resultDict = nil; + break; + } + } else { + resultDict = nil; + break; + } + } + return resultDict; +} + +- (id) deserializeArrayValue:(id) data innerType:(NSString *) innerType error:(NSError**)error { + if(![data isKindOfClass: [NSArray class]]) { + if(error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSArray class]) data:data]; + } + return nil; + } + NSMutableArray* resultArray = [NSMutableArray arrayWithCapacity:[data count]]; + for (id obj in data) { + id arrObj = [self deserialize:obj class:innerType error:error]; + if(arrObj) { + [resultArray addObject:arrObj]; + } else if([obj isKindOfClass:[NSNull class]]) { + if(self.treatNullAsError) { + if (error) { + *error = [self emptyValueOccurredError]; + } + resultArray = nil; + break; + } + } else { + resultArray = nil; + break; + } + } + return resultArray; +}; + +- (id) deserializePrimitiveValue:(id) data class:(NSString *) className error:(NSError**)error { + if ([className isEqualToString:@"NSString"]) { + return [NSString stringWithFormat:@"%@",data]; + } + else if ([className isEqualToString:@"NSDate"]) { + return [self deserializeDateValue:data error:error]; + } + else if ([className isEqualToString:@"NSNumber"]) { + // NSNumber from NSNumber + if ([data isKindOfClass:[NSNumber class]]) { + return data; + } + else if ([data isKindOfClass:[NSString class]]) { + // NSNumber (NSCFBoolean) from NSString + if ([[data lowercaseString] isEqualToString:@"true"] || [[data lowercaseString] isEqualToString:@"false"]) { + return @([data boolValue]); + // NSNumber from NSString + } else { + NSNumber* formattedValue = [self.numberFormatter numberFromString:data]; + if(!formattedValue && [data length] > 0 && error) { + *error = [self typeMismatchErrorWithExpectedType:className data:data]; + } + return formattedValue; + } + } + } + if(error) { + *error = [self typeMismatchErrorWithExpectedType:className data:data]; + } + return nil; +} + +- (id) deserializeDateValue:(id) data error:(NSError**)error { + NSDate *date =[NSDate dateWithISO8601String:data]; + if(!date && [data length] > 0 && error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDate class]) data:data]; + } + return date; +}; + +-(NSError *)typeMismatchErrorWithExpectedType:(NSString *)expected data:(id)data { + NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Received response [%@] is not an object of type %@",nil),data, expected]; + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:OAIDeserializationErrorDomainKey code:OAITypeMismatchErrorCode userInfo:userInfo]; +} + +-(NSError *)emptyValueOccurredError { + NSString * message = NSLocalizedString(@"Received response contains null value in dictionary or array response",nil); + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:OAIDeserializationErrorDomainKey code:OAIEmptyValueOccurredErrorCode userInfo:userInfo]; +} + +-(NSError *)unknownResponseErrorWithExpectedType:(NSString *)expected data:(id)data { + NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Unknown response expected type %@ [response: %@]",nil),expected,data]; + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:OAIDeserializationErrorDomainKey code:OAIUnknownResponseObjectErrorCode userInfo:userInfo]; +} + +@end diff --git a/lib/skyapi/skyapi/Core/OAISanitizer.h b/lib/skyapi/skyapi/Core/OAISanitizer.h new file mode 100644 index 0000000..fe60a54 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAISanitizer.h @@ -0,0 +1,63 @@ +#import + +/** +* 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. +*/ + + +extern NSString * OAIPercentEscapedStringFromString(NSString *string); + +extern NSString * const kOAIApplicationJSONType; + +@protocol OAISanitizer + +/** + * Sanitize object for request + * + * @param object The query/path/header/form/body param to be sanitized. + */ +- (id) sanitizeForSerialization:(id) object; + +/** + * Convert parameter to NSString + */ +- (NSString *) parameterToString: (id) param; + +/** + * Convert date to NSString + */ ++ (NSString *)dateToString:(id)date; + +/** + * Detects Accept header from accepts NSArray + * + * @param accepts NSArray of header + * + * @return The Accept header + */ +-(NSString *) selectHeaderAccept:(NSArray *)accepts; + +/** + * Detects Content-Type header from contentTypes NSArray + * + * @param contentTypes NSArray of header + * + * @return The Content-Type header + */ +-(NSString *) selectHeaderContentType:(NSArray *)contentTypes; + +@end + +@interface OAISanitizer : NSObject + + + +@end diff --git a/lib/skyapi/skyapi/Core/OAISanitizer.m b/lib/skyapi/skyapi/Core/OAISanitizer.m new file mode 100644 index 0000000..cbc3f66 --- /dev/null +++ b/lib/skyapi/skyapi/Core/OAISanitizer.m @@ -0,0 +1,170 @@ +#import "OAISanitizer.h" +#import "OAIObject.h" +#import "OAIQueryParamCollection.h" +#import "OAIDefaultConfiguration.h" +#import + +NSString * const kOAIApplicationJSONType = @"application/json"; + +NSString * OAIPercentEscapedStringFromString(NSString *string) { + static NSString * const kOAICharactersGeneralDelimitersToEncode = @":#[]@"; + static NSString * const kOAICharactersSubDelimitersToEncode = @"!$&'()*+,;="; + + NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; + [allowedCharacterSet removeCharactersInString:[kOAICharactersGeneralDelimitersToEncode stringByAppendingString:kOAICharactersSubDelimitersToEncode]]; + + static NSUInteger const batchSize = 50; + + NSUInteger index = 0; + NSMutableString *escaped = @"".mutableCopy; + + while (index < string.length) { + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wgnu" + NSUInteger length = MIN(string.length - index, batchSize); + #pragma GCC diagnostic pop + NSRange range = NSMakeRange(index, length); + + // To avoid breaking up character sequences such as 👴🏻👮🏽 + range = [string rangeOfComposedCharacterSequencesForRange:range]; + + NSString *substring = [string substringWithRange:range]; + NSString *encoded = [substring stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; + [escaped appendString:encoded]; + + index += range.length; + } + + return escaped; +} + +@interface OAISanitizer () + +@property (nonatomic, strong) NSRegularExpression* jsonHeaderTypeExpression; + +@end + +@implementation OAISanitizer + +-(instancetype)init { + self = [super init]; + if ( !self ) { + return nil; + } + _jsonHeaderTypeExpression = [NSRegularExpression regularExpressionWithPattern:@"(.*)application(.*)json(.*)" options:NSRegularExpressionCaseInsensitive error:nil]; + return self; +} + + +- (id) sanitizeForSerialization:(id) object { + if (object == nil) { + return nil; + } + else if ([object isKindOfClass:[NSString class]] || [object isKindOfClass:[NSNumber class]] || [object isKindOfClass:[OAIQueryParamCollection class]]) { + return object; + } + else if ([object isKindOfClass:[NSDate class]]) { + return [OAISanitizer dateToString:object]; + } + else if ([object isKindOfClass:[NSArray class]]) { + NSArray *objectArray = object; + NSMutableArray *sanitizedObjs = [NSMutableArray arrayWithCapacity:[objectArray count]]; + [object enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + id sanitizedObj = [self sanitizeForSerialization:obj]; + if (sanitizedObj) { + [sanitizedObjs addObject:sanitizedObj]; + } + }]; + return sanitizedObjs; + } + else if ([object isKindOfClass:[NSDictionary class]]) { + NSDictionary *objectDict = object; + NSMutableDictionary *sanitizedObjs = [NSMutableDictionary dictionaryWithCapacity:[objectDict count]]; + [object enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + id sanitizedObj = [self sanitizeForSerialization:obj]; + if (sanitizedObj) { + sanitizedObjs[key] = sanitizedObj; + } + }]; + return sanitizedObjs; + } + else if ([object isKindOfClass:[OAIObject class]]) { + return [object toDictionary]; + } + else { + NSException *e = [NSException + exceptionWithName:@"InvalidObjectArgumentException" + reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", object] + userInfo:nil]; + @throw e; + } +} + +- (NSString *) parameterToString:(id)param { + if ([param isKindOfClass:[NSString class]]) { + return param; + } + else if ([param isKindOfClass:[NSNumber class]]) { + return [param stringValue]; + } + else if ([param isKindOfClass:[NSDate class]]) { + return [OAISanitizer dateToString:param]; + } + else if ([param isKindOfClass:[NSArray class]]) { + NSMutableArray *mutableParam = [NSMutableArray array]; + [param enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [mutableParam addObject:[self parameterToString:obj]]; + }]; + return [mutableParam componentsJoinedByString:@","]; + } + else { + NSException *e = [NSException + exceptionWithName:@"InvalidObjectArgumentException" + reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", param] + userInfo:nil]; + @throw e; + } +} + ++ (NSString *)dateToString:(id)date { + NSTimeZone* timeZone = [OAIDefaultConfiguration sharedConfig].serializationTimeZone; + return [date ISO8601StringWithTimeZone:timeZone usingCalendar:nil]; +} + +#pragma mark - Utility Methods + +/* + * Detect `Accept` from accepts + */ +- (NSString *) selectHeaderAccept:(NSArray *)accepts { + if (accepts.count == 0) { + return @""; + } + NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]]; + for (NSString *string in accepts) { + if ([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0) { + return kOAIApplicationJSONType; + } + [lowerAccepts addObject:[string lowercaseString]]; + } + return [lowerAccepts componentsJoinedByString:@", "]; +} + +/* + * Detect `Content-Type` from contentTypes + */ +- (NSString *) selectHeaderContentType:(NSArray *)contentTypes { + if (contentTypes.count == 0) { + return kOAIApplicationJSONType; + } + NSMutableArray *lowerContentTypes = [[NSMutableArray alloc] initWithCapacity:[contentTypes count]]; + for (NSString *string in contentTypes) { + if([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0){ + return kOAIApplicationJSONType; + } + [lowerContentTypes addObject:[string lowercaseString]]; + } + return [lowerContentTypes firstObject]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressInputs.h b/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressInputs.h new file mode 100644 index 0000000..de95f68 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressInputs.h @@ -0,0 +1,36 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIApiv1exploreraddressInputs +@end + +@interface OAIApiv1exploreraddressInputs : OAIObject + + +@property(nonatomic) NSString* owner; + +@property(nonatomic) NSNumber* hours; + +@property(nonatomic) NSNumber* calculatedHours; + +@property(nonatomic) NSString* coins; + +@property(nonatomic) NSString* uxid; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressInputs.m b/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressInputs.m new file mode 100644 index 0000000..9b23a20 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressInputs.m @@ -0,0 +1,34 @@ +#import "OAIApiv1exploreraddressInputs.h" + +@implementation OAIApiv1exploreraddressInputs + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"owner": @"owner", @"hours": @"hours", @"calculatedHours": @"calculated_hours", @"coins": @"coins", @"uxid": @"uxid" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"owner", @"hours", @"calculatedHours", @"coins", @"uxid"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressOutputs.h b/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressOutputs.h new file mode 100644 index 0000000..af380ea --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressOutputs.h @@ -0,0 +1,34 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIApiv1exploreraddressOutputs +@end + +@interface OAIApiv1exploreraddressOutputs : OAIObject + + +@property(nonatomic) NSNumber* hours; + +@property(nonatomic) NSString* dst; + +@property(nonatomic) NSString* coins; + +@property(nonatomic) NSString* uxid; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressOutputs.m b/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressOutputs.m new file mode 100644 index 0000000..74ce967 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressOutputs.m @@ -0,0 +1,34 @@ +#import "OAIApiv1exploreraddressOutputs.h" + +@implementation OAIApiv1exploreraddressOutputs + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"hours": @"hours", @"dst": @"dst", @"coins": @"coins", @"uxid": @"uxid" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"hours", @"dst", @"coins", @"uxid"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressStatus.h b/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressStatus.h new file mode 100644 index 0000000..aff91de --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressStatus.h @@ -0,0 +1,34 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIApiv1exploreraddressStatus +@end + +@interface OAIApiv1exploreraddressStatus : OAIObject + + +@property(nonatomic) NSNumber* unconfirmed; + +@property(nonatomic) NSNumber* blockSeq; + +@property(nonatomic) NSNumber* label; + +@property(nonatomic) NSNumber* confirmed; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressStatus.m b/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressStatus.m new file mode 100644 index 0000000..66383a4 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1exploreraddressStatus.m @@ -0,0 +1,34 @@ +#import "OAIApiv1exploreraddressStatus.h" + +@implementation OAIApiv1exploreraddressStatus + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"unconfirmed": @"unconfirmed", @"blockSeq": @"block_seq", @"label": @"label", @"confirmed": @"confirmed" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"unconfirmed", @"blockSeq", @"label", @"confirmed"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1pendingTxsTransaction.h b/lib/skyapi/skyapi/Model/OAIApiv1pendingTxsTransaction.h new file mode 100644 index 0000000..a623234 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1pendingTxsTransaction.h @@ -0,0 +1,45 @@ +#import +#import "OAIObject.h" + +/** +* Skycoin REST API. +* Skycoin is a next-generation cryptocurrency. +* +* OpenAPI spec version: 0.25.1 +* Contact: skycoin.doe@example.com +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "OAIApiv1exploreraddressOutputs.h" +@protocol OAIApiv1exploreraddressOutputs; +@class OAIApiv1exploreraddressOutputs; + + + +@protocol OAIApiv1pendingTxsTransaction +@end + +@interface OAIApiv1pendingTxsTransaction : OAIObject + + +@property(nonatomic) NSArray* outputs; + +@property(nonatomic) NSString* innerHash; + +@property(nonatomic) NSArray* inputs; + +@property(nonatomic) NSArray* sigs; + +@property(nonatomic) NSNumber* length; + +@property(nonatomic) NSString* txid; + +@property(nonatomic) NSNumber* type; + +@property(nonatomic) NSNumber* timestamp; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1pendingTxsTransaction.m b/lib/skyapi/skyapi/Model/OAIApiv1pendingTxsTransaction.m new file mode 100644 index 0000000..91f6cbe --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1pendingTxsTransaction.m @@ -0,0 +1,34 @@ +#import "OAIApiv1pendingTxsTransaction.h" + +@implementation OAIApiv1pendingTxsTransaction + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"outputs": @"outputs", @"innerHash": @"inner_hash", @"inputs": @"inputs", @"sigs": @"sigs", @"length": @"length", @"txid": @"txid", @"type": @"type", @"timestamp": @"timestamp" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"outputs", @"innerHash", @"inputs", @"sigs", @"length", @"txid", @"type", @"timestamp"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1walletsEntries.h b/lib/skyapi/skyapi/Model/OAIApiv1walletsEntries.h new file mode 100644 index 0000000..f7a49bf --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1walletsEntries.h @@ -0,0 +1,30 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIApiv1walletsEntries +@end + +@interface OAIApiv1walletsEntries : OAIObject + + +@property(nonatomic) NSString* publicKey; + +@property(nonatomic) NSString* address; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1walletsEntries.m b/lib/skyapi/skyapi/Model/OAIApiv1walletsEntries.m new file mode 100644 index 0000000..4fea93b --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1walletsEntries.m @@ -0,0 +1,34 @@ +#import "OAIApiv1walletsEntries.h" + +@implementation OAIApiv1walletsEntries + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"publicKey": @"public_key", @"address": @"address" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"publicKey", @"address"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1walletsMeta.h b/lib/skyapi/skyapi/Model/OAIApiv1walletsMeta.h new file mode 100644 index 0000000..608168c --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1walletsMeta.h @@ -0,0 +1,42 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIApiv1walletsMeta +@end + +@interface OAIApiv1walletsMeta : OAIObject + + +@property(nonatomic) NSString* filename; + +@property(nonatomic) NSNumber* encrypted; + +@property(nonatomic) NSString* cryptoType; + +@property(nonatomic) NSString* label; + +@property(nonatomic) NSString* type; + +@property(nonatomic) NSString* version; + +@property(nonatomic) NSString* coin; + +@property(nonatomic) NSNumber* timestamp; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1walletsMeta.m b/lib/skyapi/skyapi/Model/OAIApiv1walletsMeta.m new file mode 100644 index 0000000..6cf1dc4 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1walletsMeta.m @@ -0,0 +1,34 @@ +#import "OAIApiv1walletsMeta.h" + +@implementation OAIApiv1walletsMeta + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"filename": @"filename", @"encrypted": @"encrypted", @"cryptoType": @"crypto_type", @"label": @"label", @"type": @"type", @"version": @"version", @"coin": @"coin", @"timestamp": @"timestamp" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"filename", @"encrypted", @"cryptoType", @"label", @"type", @"version", @"coin", @"timestamp"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionHoursSelection.h b/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionHoursSelection.h new file mode 100644 index 0000000..6498df5 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionHoursSelection.h @@ -0,0 +1,32 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIApiv1wallettransactionHoursSelection +@end + +@interface OAIApiv1wallettransactionHoursSelection : OAIObject + + +@property(nonatomic) NSString* mode; + +@property(nonatomic) NSString* shareFactor; + +@property(nonatomic) NSString* type; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionHoursSelection.m b/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionHoursSelection.m new file mode 100644 index 0000000..c866665 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionHoursSelection.m @@ -0,0 +1,34 @@ +#import "OAIApiv1wallettransactionHoursSelection.h" + +@implementation OAIApiv1wallettransactionHoursSelection + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"mode": @"mode", @"shareFactor": @"share_factor", @"type": @"type" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"mode", @"shareFactor", @"type"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionTo.h b/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionTo.h new file mode 100644 index 0000000..cae0792 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionTo.h @@ -0,0 +1,32 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIApiv1wallettransactionTo +@end + +@interface OAIApiv1wallettransactionTo : OAIObject + + +@property(nonatomic) NSNumber* hours; + +@property(nonatomic) NSString* address; + +@property(nonatomic) NSNumber* coins; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionTo.m b/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionTo.m new file mode 100644 index 0000000..180ae80 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionTo.m @@ -0,0 +1,34 @@ +#import "OAIApiv1wallettransactionTo.h" + +@implementation OAIApiv1wallettransactionTo + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"hours": @"hours", @"address": @"address", @"coins": @"coins" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"hours", @"address", @"coins"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionWallet.h b/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionWallet.h new file mode 100644 index 0000000..c10fda5 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionWallet.h @@ -0,0 +1,34 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIApiv1wallettransactionWallet +@end + +@interface OAIApiv1wallettransactionWallet : OAIObject + + +@property(nonatomic) NSArray* unspents; + +@property(nonatomic) NSArray* addresses; + +@property(nonatomic) NSString* password; + +@property(nonatomic) NSString* _id; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionWallet.m b/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionWallet.m new file mode 100644 index 0000000..389f541 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIApiv1wallettransactionWallet.m @@ -0,0 +1,34 @@ +#import "OAIApiv1wallettransactionWallet.h" + +@implementation OAIApiv1wallettransactionWallet + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"unspents": @"unspents", @"addresses": @"addresses", @"password": @"password", @"_id": @"id" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"unspents", @"addresses", @"password", @"_id"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineObject.h b/lib/skyapi/skyapi/Model/OAIInlineObject.h new file mode 100644 index 0000000..c97e18c --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineObject.h @@ -0,0 +1,45 @@ +#import +#import "OAIObject.h" + +/** +* Skycoin REST API. +* Skycoin is a next-generation cryptocurrency. +* +* OpenAPI spec version: 0.25.1 +* Contact: skycoin.doe@example.com +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "OAIApiv1wallettransactionHoursSelection.h" +#import "OAIApiv1wallettransactionTo.h" +#import "OAIApiv1wallettransactionWallet.h" +@protocol OAIApiv1wallettransactionHoursSelection; +@class OAIApiv1wallettransactionHoursSelection; +@protocol OAIApiv1wallettransactionTo; +@class OAIApiv1wallettransactionTo; +@protocol OAIApiv1wallettransactionWallet; +@class OAIApiv1wallettransactionWallet; + + + +@protocol OAIInlineObject +@end + +@interface OAIInlineObject : OAIObject + + +@property(nonatomic) NSString* changeAddress; + +@property(nonatomic) OAIApiv1wallettransactionHoursSelection* hoursSelection; + +@property(nonatomic) NSNumber* ignoreUnconfirmed; + +@property(nonatomic) NSArray* to; + +@property(nonatomic) OAIApiv1wallettransactionWallet* wallet; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineObject.m b/lib/skyapi/skyapi/Model/OAIInlineObject.m new file mode 100644 index 0000000..993f59a --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineObject.m @@ -0,0 +1,34 @@ +#import "OAIInlineObject.h" + +@implementation OAIInlineObject + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"changeAddress": @"change_address", @"hoursSelection": @"hours_selection", @"ignoreUnconfirmed": @"ignore_unconfirmed", @"to": @"to", @"wallet": @"wallet" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"changeAddress", @"hoursSelection", @"ignoreUnconfirmed", @"to", @"wallet"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse200.h b/lib/skyapi/skyapi/Model/OAIInlineResponse200.h new file mode 100644 index 0000000..443dcfc --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse200.h @@ -0,0 +1,44 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIInlineResponse200 +@end + +@interface OAIInlineResponse200 : OAIObject + + +@property(nonatomic) NSNumber* hours; + +@property(nonatomic) NSNumber* coins; + +@property(nonatomic) NSString* uxid; + +@property(nonatomic) NSString* ownerAddress; + +@property(nonatomic) NSNumber* spentBlockSeq; + +@property(nonatomic) NSString* spentTx; + +@property(nonatomic) NSNumber* time; + +@property(nonatomic) NSNumber* srcBlockSeq; + +@property(nonatomic) NSString* srcTx; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse200.m b/lib/skyapi/skyapi/Model/OAIInlineResponse200.m new file mode 100644 index 0000000..8bea2a3 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse200.m @@ -0,0 +1,34 @@ +#import "OAIInlineResponse200.h" + +@implementation OAIInlineResponse200 + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"hours": @"hours", @"coins": @"coins", @"uxid": @"uxid", @"ownerAddress": @"owner_address", @"spentBlockSeq": @"spent_block_seq", @"spentTx": @"spent_tx", @"time": @"time", @"srcBlockSeq": @"src_block_seq", @"srcTx": @"src_tx" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"hours", @"coins", @"uxid", @"ownerAddress", @"spentBlockSeq", @"spentTx", @"time", @"srcBlockSeq", @"srcTx"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2001.h b/lib/skyapi/skyapi/Model/OAIInlineResponse2001.h new file mode 100644 index 0000000..3ead44c --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2001.h @@ -0,0 +1,28 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIInlineResponse2001 +@end + +@interface OAIInlineResponse2001 : OAIObject + + +@property(nonatomic) NSString* csrfToken; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2001.m b/lib/skyapi/skyapi/Model/OAIInlineResponse2001.m new file mode 100644 index 0000000..229b589 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2001.m @@ -0,0 +1,34 @@ +#import "OAIInlineResponse2001.h" + +@implementation OAIInlineResponse2001 + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"csrfToken": @"csrf_token" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"csrfToken"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2002.h b/lib/skyapi/skyapi/Model/OAIInlineResponse2002.h new file mode 100644 index 0000000..d66bcd1 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2002.h @@ -0,0 +1,55 @@ +#import +#import "OAIObject.h" + +/** +* Skycoin REST API. +* Skycoin is a next-generation cryptocurrency. +* +* OpenAPI spec version: 0.25.1 +* Contact: skycoin.doe@example.com +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "OAIApiv1exploreraddressInputs.h" +#import "OAIApiv1exploreraddressOutputs.h" +#import "OAIApiv1exploreraddressStatus.h" +@protocol OAIApiv1exploreraddressInputs; +@class OAIApiv1exploreraddressInputs; +@protocol OAIApiv1exploreraddressOutputs; +@class OAIApiv1exploreraddressOutputs; +@protocol OAIApiv1exploreraddressStatus; +@class OAIApiv1exploreraddressStatus; + + + +@protocol OAIInlineResponse2002 +@end + +@interface OAIInlineResponse2002 : OAIObject + + +@property(nonatomic) NSArray* outputs; + +@property(nonatomic) NSString* innerHash; + +@property(nonatomic) NSArray* inputs; + +@property(nonatomic) NSNumber* fee; + +@property(nonatomic) NSArray* sigs; + +@property(nonatomic) NSNumber* length; + +@property(nonatomic) NSString* txid; + +@property(nonatomic) NSNumber* type; + +@property(nonatomic) OAIApiv1exploreraddressStatus* status; + +@property(nonatomic) NSNumber* timestamp; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2002.m b/lib/skyapi/skyapi/Model/OAIInlineResponse2002.m new file mode 100644 index 0000000..b4d4d14 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2002.m @@ -0,0 +1,34 @@ +#import "OAIInlineResponse2002.h" + +@implementation OAIInlineResponse2002 + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"outputs": @"outputs", @"innerHash": @"inner_hash", @"inputs": @"inputs", @"fee": @"fee", @"sigs": @"sigs", @"length": @"length", @"txid": @"txid", @"type": @"type", @"status": @"status", @"timestamp": @"timestamp" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"outputs", @"innerHash", @"inputs", @"fee", @"sigs", @"length", @"txid", @"type", @"status", @"timestamp"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2003.h b/lib/skyapi/skyapi/Model/OAIInlineResponse2003.h new file mode 100644 index 0000000..f708c8b --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2003.h @@ -0,0 +1,55 @@ +#import +#import "OAIObject.h" + +/** +* Skycoin REST API. +* Skycoin is a next-generation cryptocurrency. +* +* OpenAPI spec version: 0.25.1 +* Contact: skycoin.doe@example.com +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "OAIInlineResponse2003UnconfirmedVerifyTransaction.h" +@protocol OAIInlineResponse2003UnconfirmedVerifyTransaction; +@class OAIInlineResponse2003UnconfirmedVerifyTransaction; + + + +@protocol OAIInlineResponse2003 +@end + +@interface OAIInlineResponse2003 : OAIObject + + +@property(nonatomic) NSNumber* lastReceived; + +@property(nonatomic) NSNumber* lastSent; + +@property(nonatomic) NSNumber* outgoing; + +@property(nonatomic) NSNumber* mirror; + +@property(nonatomic) NSString* address; + +@property(nonatomic) NSNumber* listenPort; + +@property(nonatomic) NSNumber* isTrustedPeer; + +@property(nonatomic) NSNumber* connectedAt; + +@property(nonatomic) OAIInlineResponse2003UnconfirmedVerifyTransaction* unconfirmedVerifyTransaction; + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* state; + +@property(nonatomic) NSString* userAgent; + +@property(nonatomic) NSNumber* height; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2003.m b/lib/skyapi/skyapi/Model/OAIInlineResponse2003.m new file mode 100644 index 0000000..2b7671f --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2003.m @@ -0,0 +1,34 @@ +#import "OAIInlineResponse2003.h" + +@implementation OAIInlineResponse2003 + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"lastReceived": @"last_received", @"lastSent": @"last_sent", @"outgoing": @"outgoing", @"mirror": @"mirror", @"address": @"address", @"listenPort": @"listen_port", @"isTrustedPeer": @"is_trusted_peer", @"connectedAt": @"connected_at", @"unconfirmedVerifyTransaction": @"unconfirmed_verify_transaction", @"_id": @"id", @"state": @"state", @"userAgent": @"user_agent", @"height": @"height" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"lastReceived", @"lastSent", @"outgoing", @"mirror", @"address", @"listenPort", @"isTrustedPeer", @"connectedAt", @"unconfirmedVerifyTransaction", @"_id", @"state", @"userAgent", @"height"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2003UnconfirmedVerifyTransaction.h b/lib/skyapi/skyapi/Model/OAIInlineResponse2003UnconfirmedVerifyTransaction.h new file mode 100644 index 0000000..078d854 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2003UnconfirmedVerifyTransaction.h @@ -0,0 +1,32 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIInlineResponse2003UnconfirmedVerifyTransaction +@end + +@interface OAIInlineResponse2003UnconfirmedVerifyTransaction : OAIObject + + +@property(nonatomic) NSNumber* burnFactor; + +@property(nonatomic) NSNumber* maxTransactionSize; + +@property(nonatomic) NSNumber* maxDecimals; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2003UnconfirmedVerifyTransaction.m b/lib/skyapi/skyapi/Model/OAIInlineResponse2003UnconfirmedVerifyTransaction.m new file mode 100644 index 0000000..a49b9d2 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2003UnconfirmedVerifyTransaction.m @@ -0,0 +1,34 @@ +#import "OAIInlineResponse2003UnconfirmedVerifyTransaction.h" + +@implementation OAIInlineResponse2003UnconfirmedVerifyTransaction + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"burnFactor": @"burn_factor", @"maxTransactionSize": @"max_transaction_size", @"maxDecimals": @"max_decimals" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"burnFactor", @"maxTransactionSize", @"maxDecimals"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2004.h b/lib/skyapi/skyapi/Model/OAIInlineResponse2004.h new file mode 100644 index 0000000..60a7e1c --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2004.h @@ -0,0 +1,39 @@ +#import +#import "OAIObject.h" + +/** +* Skycoin REST API. +* Skycoin is a next-generation cryptocurrency. +* +* OpenAPI spec version: 0.25.1 +* Contact: skycoin.doe@example.com +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "OAIApiv1pendingTxsTransaction.h" +@protocol OAIApiv1pendingTxsTransaction; +@class OAIApiv1pendingTxsTransaction; + + + +@protocol OAIInlineResponse2004 +@end + +@interface OAIInlineResponse2004 : OAIObject + + +@property(nonatomic) NSString* announced; + +@property(nonatomic) NSNumber* isValid; + +@property(nonatomic) NSString* checked; + +@property(nonatomic) NSString* received; + +@property(nonatomic) OAIApiv1pendingTxsTransaction* transaction; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2004.m b/lib/skyapi/skyapi/Model/OAIInlineResponse2004.m new file mode 100644 index 0000000..a75f0aa --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2004.m @@ -0,0 +1,34 @@ +#import "OAIInlineResponse2004.h" + +@implementation OAIInlineResponse2004 + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"announced": @"announced", @"isValid": @"is_valid", @"checked": @"checked", @"received": @"received", @"transaction": @"transaction" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"announced", @"isValid", @"checked", @"received", @"transaction"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2005.h b/lib/skyapi/skyapi/Model/OAIInlineResponse2005.h new file mode 100644 index 0000000..ae108fb --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2005.h @@ -0,0 +1,36 @@ +#import +#import "OAIObject.h" + +/** +* Skycoin REST API. +* Skycoin is a next-generation cryptocurrency. +* +* OpenAPI spec version: 0.25.1 +* Contact: skycoin.doe@example.com +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "OAIApiv1walletsEntries.h" +#import "OAIApiv1walletsMeta.h" +@protocol OAIApiv1walletsEntries; +@class OAIApiv1walletsEntries; +@protocol OAIApiv1walletsMeta; +@class OAIApiv1walletsMeta; + + + +@protocol OAIInlineResponse2005 +@end + +@interface OAIInlineResponse2005 : OAIObject + + +@property(nonatomic) NSArray* entries; + +@property(nonatomic) OAIApiv1walletsMeta* meta; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2005.m b/lib/skyapi/skyapi/Model/OAIInlineResponse2005.m new file mode 100644 index 0000000..8a3e623 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2005.m @@ -0,0 +1,34 @@ +#import "OAIInlineResponse2005.h" + +@implementation OAIInlineResponse2005 + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"entries": @"entries", @"meta": @"meta" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"entries", @"meta"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2006.h b/lib/skyapi/skyapi/Model/OAIInlineResponse2006.h new file mode 100644 index 0000000..caa9877 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2006.h @@ -0,0 +1,28 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIInlineResponse2006 +@end + +@interface OAIInlineResponse2006 : OAIObject + + +@property(nonatomic) NSString* address; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2006.m b/lib/skyapi/skyapi/Model/OAIInlineResponse2006.m new file mode 100644 index 0000000..195f1b7 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2006.m @@ -0,0 +1,34 @@ +#import "OAIInlineResponse2006.h" + +@implementation OAIInlineResponse2006 + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"address": @"address" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"address"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2007.h b/lib/skyapi/skyapi/Model/OAIInlineResponse2007.h new file mode 100644 index 0000000..9c7d68d --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2007.h @@ -0,0 +1,33 @@ +#import +#import "OAIObject.h" + +/** +* Skycoin REST API. +* Skycoin is a next-generation cryptocurrency. +* +* OpenAPI spec version: 0.25.1 +* Contact: skycoin.doe@example.com +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "OAIInlineResponse2007Data.h" +@protocol OAIInlineResponse2007Data; +@class OAIInlineResponse2007Data; + + + +@protocol OAIInlineResponse2007 +@end + +@interface OAIInlineResponse2007 : OAIObject + + +@property(nonatomic) OAIInlineResponse2007Data* data; + +@property(nonatomic) NSObject* error; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2007.m b/lib/skyapi/skyapi/Model/OAIInlineResponse2007.m new file mode 100644 index 0000000..872d2d0 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2007.m @@ -0,0 +1,34 @@ +#import "OAIInlineResponse2007.h" + +@implementation OAIInlineResponse2007 + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"data": @"data", @"error": @"error" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"data", @"error"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2007Data.h b/lib/skyapi/skyapi/Model/OAIInlineResponse2007Data.h new file mode 100644 index 0000000..393926c --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2007Data.h @@ -0,0 +1,28 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIInlineResponse2007Data +@end + +@interface OAIInlineResponse2007Data : OAIObject + + +@property(nonatomic) NSNumber* version; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponse2007Data.m b/lib/skyapi/skyapi/Model/OAIInlineResponse2007Data.m new file mode 100644 index 0000000..85db03e --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponse2007Data.m @@ -0,0 +1,34 @@ +#import "OAIInlineResponse2007Data.h" + +@implementation OAIInlineResponse2007Data + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"version": @"version" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"version"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponseDefault.h b/lib/skyapi/skyapi/Model/OAIInlineResponseDefault.h new file mode 100644 index 0000000..ecf7d3f --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponseDefault.h @@ -0,0 +1,30 @@ +#import +#import "OAIObject.h" + +/** +* 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. +*/ + + + + + +@protocol OAIInlineResponseDefault +@end + +@interface OAIInlineResponseDefault : OAIObject + + +@property(nonatomic) NSNumber* code; + +@property(nonatomic) NSString* message; + +@end diff --git a/lib/skyapi/skyapi/Model/OAIInlineResponseDefault.m b/lib/skyapi/skyapi/Model/OAIInlineResponseDefault.m new file mode 100644 index 0000000..908cba3 --- /dev/null +++ b/lib/skyapi/skyapi/Model/OAIInlineResponseDefault.m @@ -0,0 +1,34 @@ +#import "OAIInlineResponseDefault.h" + +@implementation OAIInlineResponseDefault + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"code": @"code", @"message": @"message" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"code", @"message"]; + return [optionalProperties containsObject:propertyName]; +} + +@end