Browse Source

📲 Update to v1.2.0-Stable (Axios)

pull/3/head
Brendan Lane 11 months ago
parent
commit
0843b004ef
  1. 2
      modules/auth.js
  2. 8
      modules/eco.js
  3. 2
      package.json
  4. 6
      routes.md

2
modules/auth.js

@ -13,7 +13,7 @@ let urlReturn;
* @param {string} response_type The type of response you get back. Currently the only one that is supported is "code". This parameter is requried.
* @param {string} client_id The client ID of your Oauth2 app. To get your client ID, go to https://spookvooper.com/oauth2. This parameter is requried.
* @param {string} redirect_uri Where to redirect to once authorization has been granted. Will return a "code" and "state" parameter if successful. This parameter is requried.
* @param {string} scope The scope of what you want to be able to receive. Currently the only supported scope is "view". This parameter is requried.
* @param {string} scope The scope of what you want to be able to receive. All scopes are allowed. This parameter is requried.
* @param {string} state The state parameter can have anything here. Will be returned to the server upon completion. This parameter is optional.
* @returns {string} Will return a string containing a link to the Oauth2 authorization page. If there is an error, it will return "ERROR: Oauth2 URL Builder - A required variable is undefined or is missing."
*/

8
modules/eco.js

@ -36,7 +36,7 @@ function getBalance(svid, errToConsole) {
* @param {string} to The svid of the user/group you want to send the payment to
* @param {string} from The svid of the user/group you want to send the payment from
* @param {string} amount The amount of money to be sent
* @param {string} auth An api key which has permission to use funds from the sender
* @param {string} auth An api key which has permission to use funds from the sender or use oauthkey|app_secret formula for Oauth2.
* @param {string} detail A short detail of why the payment happened. Must include "sale" if it was a sale.
* @param {boolean} errToConsole If there is an error, send it to console, instead of returning. Defaults to false
* @returns {string} The data from the HTTP GET request, but because of the way it's handled, will always be a string (should be a string).
@ -116,7 +116,7 @@ function getStockHistory(ticker, type, count, interval, errToConsole) {
* @param {string} count How many stocks you want to purchase
* @param {string} price How much you want to pay for each stock
* @param {string} accountid The SVID of the account (user or group) you'd like to purchase from.
* @param {string} auth API Key that has authentication to use the account specified in accountid.
* @param {string} auth API Key that has authentication to use the account specified in accountid or use oauthkey|app_secret formula for Oauth2.
* @param {boolean} errToConsole If there is an error, send it to console, instead of returning. Defaults to false
* @returns {string} The data from the HTTP GET request, but because of the way it's handled, will always be a string (should be a tesult).
* @author Brendan Lane <me@imbl.me>
@ -144,7 +144,7 @@ function submitStockBuy(ticker, count, price, accountid, auth, errToConsole) {
* @param {string} count How many stocks you want to sell
* @param {string} price How much you want to sell each stock for
* @param {string} accountid The SVID of the account (user or group) you'd like to sell from.
* @param {string} auth API Key that has authentication to use the account specified in accountid.
* @param {string} auth API Key that has authentication to use the account specified in accountid or use oauthkey|app_secret formula for Oauth2.
* @param {boolean} errToConsole If there is an error, send it to console, instead of returning. Defaults to false
* @returns {string} The data from the HTTP GET request, but because of the way it's handled, will always be a string (should be a result).
* @author Brendan Lane <me@imbl.me>
@ -170,7 +170,7 @@ function submitStockSell(ticker, count, price, accountid, auth, errToConsole) {
* @function cancelOrder
* @param {string} orderid The ID of the order you'd like to cancel.
* @param {string} accountid The SVID of the account (user or group) you'd like to purchase from.
* @param {string} auth API Key that has authentication to use the account specified in accountid.
* @param {string} auth API Key that has authentication to use the account specified in accountid or use oauthkey|app_secret formula for Oauth2.
* @param {boolean} errToConsole If there is an error, send it to console, instead of returning. Defaults to false
* @returns {string} The data from the HTTP GET request, but because of the way it's handled, will always be a string (should be a result).
* @author Brendan Lane <me@imbl.me>

2
package.json

@ -1,6 +1,6 @@
{
"name": "spookvooperapi",
"version": "1.1.0",
"version": "1.2.0",
"description": "Easy to use library for the SpookVooper API",
"main": "main.js",
"type": "module",

6
routes.md

@ -56,6 +56,8 @@ You can register apps at: <https://spookvooper.com/oauth2>
### What are the scopes
Currently, the only scope is View. This will be extended to eco/plot/etc in the future.
All scopes are now supported! Separate them with commas. The simplest scope is "view", which just gives you the id of the account. Also useful is "eco".
This is currently new and may have bugs. Try not to bug me without specific issues.
### How do I use the key?
Instead of an API key, format a key as "oauthkey|app_secret". SV will automatically split the two.

Loading…
Cancel
Save