Skip to content

Commit

Permalink
[skyapi] refs #5 Added Objetive C wrapper for Skycoin Api
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevMac committed Mar 15, 2019
1 parent a3b1f1a commit be7cbc0
Show file tree
Hide file tree
Showing 94 changed files with 10,823 additions and 0 deletions.
53 changes: 53 additions & 0 deletions lib/skyapi/.gitignore
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions lib/skyapi/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions lib/skyapi/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.4
196 changes: 196 additions & 0 deletions lib/skyapi/README.md
Original file line number Diff line number Diff line change
@@ -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 <skyapi/OAIApiClient.h>
#import <skyapi/OAIDefaultConfiguration.h>
// load models
#import <skyapi/OAIApiv1exploreraddressInputs.h>
#import <skyapi/OAIApiv1exploreraddressOutputs.h>
#import <skyapi/OAIApiv1exploreraddressStatus.h>
#import <skyapi/OAIApiv1pendingTxsTransaction.h>
#import <skyapi/OAIApiv1walletsEntries.h>
#import <skyapi/OAIApiv1walletsMeta.h>
#import <skyapi/OAIApiv1wallettransactionHoursSelection.h>
#import <skyapi/OAIApiv1wallettransactionTo.h>
#import <skyapi/OAIApiv1wallettransactionWallet.h>
#import <skyapi/OAIInlineObject.h>
#import <skyapi/OAIInlineResponse200.h>
#import <skyapi/OAIInlineResponse2001.h>
#import <skyapi/OAIInlineResponse2002.h>
#import <skyapi/OAIInlineResponse2003.h>
#import <skyapi/OAIInlineResponse2003UnconfirmedVerifyTransaction.h>
#import <skyapi/OAIInlineResponse2004.h>
#import <skyapi/OAIInlineResponse2005.h>
#import <skyapi/OAIInlineResponse2006.h>
#import <skyapi/OAIInlineResponse2007.h>
#import <skyapi/OAIInlineResponse2007Data.h>
#import <skyapi/OAIInlineResponseDefault.h>
// load API classes for accessing endpoints
#import <skyapi/OAIDefaultApi.h>

```

## 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&#39;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
[email protected]
14 changes: 14 additions & 0 deletions lib/skyapi/docs/OAIApiv1exploreraddressInputs.md
Original file line number Diff line number Diff line change
@@ -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)


13 changes: 13 additions & 0 deletions lib/skyapi/docs/OAIApiv1exploreraddressOutputs.md
Original file line number Diff line number Diff line change
@@ -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)


13 changes: 13 additions & 0 deletions lib/skyapi/docs/OAIApiv1exploreraddressStatus.md
Original file line number Diff line number Diff line change
@@ -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)


17 changes: 17 additions & 0 deletions lib/skyapi/docs/OAIApiv1pendingTxsTransaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# OAIApiv1pendingTxsTransaction

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**outputs** | [**NSArray&lt;OAIApiv1exploreraddressOutputs&gt;***](OAIApiv1exploreraddressOutputs.md) | | [optional]
**innerHash** | **NSString*** | | [optional]
**inputs** | **NSArray&lt;NSString*&gt;*** | | [optional]
**sigs** | **NSArray&lt;NSString*&gt;*** | | [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)


11 changes: 11 additions & 0 deletions lib/skyapi/docs/OAIApiv1walletsEntries.md
Original file line number Diff line number Diff line change
@@ -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)


17 changes: 17 additions & 0 deletions lib/skyapi/docs/OAIApiv1walletsMeta.md
Original file line number Diff line number Diff line change
@@ -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)


12 changes: 12 additions & 0 deletions lib/skyapi/docs/OAIApiv1wallettransactionHoursSelection.md
Original file line number Diff line number Diff line change
@@ -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)


12 changes: 12 additions & 0 deletions lib/skyapi/docs/OAIApiv1wallettransactionTo.md
Original file line number Diff line number Diff line change
@@ -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)


Loading

0 comments on commit be7cbc0

Please sign in to comment.