From a169c0f7d0c3e3f8626742f0a4bb33be106a6558 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Fri, 7 Aug 2020 18:03:55 -0700 Subject: [PATCH] fix(docs): Adding deploy script to automatically update documentation --- .travis.yml | 2 +- deploy-production.sh | 14 ++++ src/slp/utils.js | 78 ---------------------- test/integration/testnet/test-free-tier.sh | 1 + 4 files changed, 16 insertions(+), 79 deletions(-) create mode 100755 deploy-production.sh diff --git a/.travis.yml b/.travis.yml index acfca19..ffc1c17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,4 +27,4 @@ deploy: provider: script skip_cleanup: true script: - - npx semantic-release + - npx semantic-release && ./deploy-production.sh diff --git a/deploy-production.sh b/deploy-production.sh new file mode 100755 index 0000000..0703498 --- /dev/null +++ b/deploy-production.sh @@ -0,0 +1,14 @@ +# Triggers a webhook to update the staging server at staging.fullstack.cash. + +#!/bin/bash +#echo $DEPLOY_SECRET + +echo "Deploy to production...." + +export DATA="{\"ref\":\"$DEPLOY_SECRET\"}" + +#echo $DATA + +curl -X POST http://fullstack.cash:9000/hooks/bch-js -H "Content-Type: application/json" -d $DATA + +echo "...Finished deploying to production." diff --git a/src/slp/utils.js b/src/slp/utils.js index da0b7d6..72bf466 100644 --- a/src/slp/utils.js +++ b/src/slp/utils.js @@ -370,84 +370,6 @@ class Utils { } } - /** - * @api SLP.Utils.balance() balance() - * @apiName balance - * @apiGroup SLP Utils - * @apiDescription Return single balance for an address by token id. - * - * @apiExample Example usage: - * - * // single balance for SLP Address - * (async () => { - * try { - * let balance = await bchjs.SLP.Utils.balance( - * "simpleledger:qr5agtachyxvrwxu76vzszan5pnvuzy8duhv4lxrsk", - * "df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb" - * ); - * console.log(balance); - * } catch (error) { - * console.error(error); - * } - * })(); - * - * // returns - * // { tokenId: - * // 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', - * // balance: '617', - * // decimalCount: 8 } - * - * // single balance for Cash Address - * (async () => { - * try { - * let balance = await bchjs.SLP.Utils.balance( - * "bitcoincash:qr5agtachyxvrwxu76vzszan5pnvuzy8dumh7ynrwg", - * "df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb" - * ); - * console.log(balance); - * } catch (error) { - * console.error(error); - * } - * })(); - * - * // returns - * // { tokenId: - * // 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', - * // balance: '617', - * // decimalCount: 8 } - * - * // single balance for Legacy Address - * (async () => { - * try { - * let balance = await bchjs.SLP.Utils.balance( - * "1DwQqpWc8pzaRydCmiJsPdoqCzmjSQQbp8", - * "467969e067f5612863d0bf2daaa70dede2c6be03abb6fd401c5ef6e1e1f1f5c5" - * ); - * console.log(balance); - * } catch (error) { - * console.error(error); - * } - * })(); - * - * // returns - * // { tokenId: - * // '467969e067f5612863d0bf2daaa70dede2c6be03abb6fd401c5ef6e1e1f1f5c5', - * // balance: '1234', - * // decimalCount: 2 } - */ - // Retrieve a balance for a specific address and token ID - async balance(address, tokenId) { - const path = `${this.restURL}slp/balance/${address}/${tokenId}` - - try { - const response = await axios.get(path, _this.axiosOptions) - return response.data - } catch (error) { - if (error.response && error.response.data) throw error.response.data - throw error - } - } - /** * @api SLP.Utils.validateTxid() validateTxid() * @apiName validateTxid diff --git a/test/integration/testnet/test-free-tier.sh b/test/integration/testnet/test-free-tier.sh index 2658fbf..623f10f 100755 --- a/test/integration/testnet/test-free-tier.sh +++ b/test/integration/testnet/test-free-tier.sh @@ -6,3 +6,4 @@ export NETWORK=testnet cd test/integration/testnet/ mocha --timeout 30000 blockchain.js control.js electrumx.js openbazaar.js rawtransaction.js slp.js util.js +#mocha --timeout 30000 blockchain.js