forked from fibercrypto/libjs-skycoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
cbermudez97
committed
Apr 3, 2019
1 parent
c5fd126
commit 251f471
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Skyapi, a Wrapper for Skycoin Api | ||
|
||
This wrapper is Auto generated by openapi-generator directly from `Skycoin Api` code for version v0.25.1. | ||
|
||
## Skyapi-Axios | ||
|
||
Generated using the typescript-axios generator. | ||
|
||
### Installation | ||
|
||
Navigate to the folder of your consuming project and run the following command. | ||
|
||
``` | ||
npm install [email protected] --save | ||
``` | ||
|
||
### Specific Node Address | ||
|
||
For use a specific node of Skycoin, you just need to create a instance of `DefaultApi` passing a `Configuration` instance and the node address: | ||
|
||
```js | ||
// Load the skyapi-axios module | ||
const skyapi_axios = require("libsky-axios"); | ||
|
||
// Define path to skycoin node | ||
const basePath = 'https://node.skycoin.net'; | ||
|
||
// Create a default configuration class | ||
let api_axios_config = new skyapi_axios.Configuration(); | ||
|
||
// Create API instance | ||
let api_axios = new skyapi_axios.DefaultApi(api_axios_config, basePath); | ||
|
||
// Make a request for the version to the skycoin node | ||
api_axios.version().then(result => { | ||
//Log the response data field | ||
console.log(`Response from skycoin node in ${basePath} using axios client: ${JSON.stringify(result.data)}`); | ||
}); | ||
|
||
``` | ||
|
||
## Skyapi-Node | ||
|
||
Generated using the typescript-node generator. | ||
|
||
### Installation | ||
|
||
Navigate to the folder of your consuming project and run the following command. | ||
|
||
``` | ||
npm install [email protected] --save | ||
``` | ||
|
||
|
||
### Specific Node Address | ||
|
||
For use a specific node of Skycoin, you just need to create a instance of `DefaultApi` passing the node address: | ||
|
||
```js | ||
// Load the skyapi-node module | ||
const skyapi_node = require("libsky-node"); | ||
|
||
// Define path to skycoin node | ||
const basePath = 'https://node.skycoin.net'; | ||
|
||
// Create API instance | ||
let api_node = new skyapi_node.DefaultApi(basePath); | ||
|
||
// Make a request for the version to the skycoin node | ||
api_node.version().then(result => { | ||
//Log the response body field | ||
console.log(`Response from skycoin node in ${basePath} using axios client: ${JSON.stringify(result.body)}`); | ||
}); | ||
|
||
``` |