mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
fix(docs): Adding deploy script to automatically update documentation
This commit is contained in:
+1
-1
@@ -27,4 +27,4 @@ deploy:
|
||||
provider: script
|
||||
skip_cleanup: true
|
||||
script:
|
||||
- npx semantic-release
|
||||
- npx semantic-release && ./deploy-production.sh
|
||||
|
||||
Executable
+14
@@ -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."
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user