Skip to content

Commit 0a6cc93

Browse files
authored
Merge pull request #1 from Ryabina-io/ci
Ci
2 parents 023a373 + bb3fc1e commit 0a6cc93

24 files changed

Lines changed: 3877 additions & 3274 deletions

.github/workflows/npm-publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: Node.js Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
publish-npm:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v1
16+
with:
17+
node-version: 14
18+
registry-url: https://registry.npmjs.org/
19+
- run: npm publish
20+
working-directory: ./packages/core
21+
env:
22+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.prettierrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"trailingComma": "es5",
3+
"semi": false,
4+
"arrowParens": "avoid"
5+
}

package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"scripts": {
3+
"prettier": "prettier --write packages"
4+
},
5+
"devDependencies": {
6+
"husky": "^4.2.5",
7+
"prettier": "2.0.5",
8+
"pretty-quick": "^2.0.1"
9+
},
10+
"husky": {
11+
"hooks": {
12+
"pre-commit": "pretty-quick --staged"
13+
}
14+
}
15+
}

packages/acala/README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Telegram 🤖️ for Acala users to monitor their financial status - loan positions, liquidation events, balance changes, liquidity provision and returns.
44

55
### Launching:
6+
67
```
78
export BOT_TOKEN=telegram_bot_token
89
export DB_FILE_PATH=path_to_dbjson_file
@@ -19,36 +20,36 @@ There are two main functions: to alert about events that take place with account
1920

2021
Bot can be used in two ways:
2122

22-
* as a **personal** informational bot, sending alerts in a private chat;
23+
- as a **personal** informational bot, sending alerts in a private chat;
2324

24-
* as informational bot for **Telegram groups** showing statistic of network and current prices of currencies(ACA, DOT, LDOT, RenBTC, XBTC and others).
25+
- as informational bot for **Telegram groups** showing statistic of network and current prices of currencies(ACA, DOT, LDOT, RenBTC, XBTC and others).
2526

2627
## **Personal informational bot.**
2728

2829
You can find it here: [https://t.me/Acala_Ryabina_bot](https://t.me/Acala_Ryabina_bot)
2930
All notifications are divided into 6 groups:
3031

31-
* **Accounts alerts** is a block of notifications about Transfers and Ren Mint/Burn.
32+
- **Accounts alerts** is a block of notifications about Transfers and Ren Mint/Burn.
3233

33-
* **CDP Loans**💰****all alerts about loans, Collateralized Debt Positions(CDP)
34+
- **CDP Loans**💰****all alerts about loans, Collateralized Debt Positions(CDP)
3435

35-
You can find here one of the most useful alerts - "***liquidate CDP warning***", that means that tracked CDP is dangerously close to liquidation (115% of liquidation price) and, perhaps, need some actions to be done.
36+
You can find here one of the most useful alerts - "**_liquidate CDP warning_**", that means that tracked CDP is dangerously close to liquidation (115% of liquidation price) and, perhaps, need some actions to be done.
3637

37-
* **Liquidation Auction** — about auction bids and auctions.
38+
- **Liquidation Auction** — about auction bids and auctions.
3839

39-
* **Honzon Parameters**. Honzon — The Stablecoin Protocol. No address required.
40+
- **Honzon Parameters**. Honzon — The Stablecoin Protocol. No address required.
4041

41-
* **Dex — Swap, Deposit and Earn**. All events related to swap, Deposit & Earn, add/withdraw liquidity.
42+
- **Dex — Swap, Deposit and Earn**. All events related to swap, Deposit & Earn, add/withdraw liquidity.
4243

43-
* 🔥**Advanced**🔥 collected all the events and extrinsics of all the modules. It’s a big list.
44+
- 🔥**Advanced**🔥 collected all the events and extrinsics of all the modules. It’s a big list.
4445

4546
### Usage
4647

4748
Click Add new alert
4849

4950
![](https://cdn-images-1.medium.com/max/4440/1*DQge566sOSyovWIoRwYJHQ.png)
5051

51-
Select one of the groups, you will see a list of alerts.
52+
Select one of the groups, you will see a list of alerts.
5253
You can 🟢select/⚪deselect only those points you need. After selecting, choose Enter address.
5354

5455
![](https://cdn-images-1.medium.com/max/2000/1*bWUyn4Z6j_kXzYWQyUXPew.png)
@@ -81,7 +82,7 @@ After selecting a module you are required to select a type of alert: Extrinsics
8182

8283
Next step is to set up Filters. Please be noted that correct use of Filters is very important stage and helps you to avoid unnecessary information.
8384

84-
*For example: in case Filter Target is not selected for Event Transfer bot will send information about ALL transfers in the network.
85+
\*For example: in case Filter Target is not selected for Event Transfer bot will send information about ALL transfers in the network.
8586

8687
![](https://cdn-images-1.medium.com/max/2140/1*qrEgWap23G6M8Kmo5Fmmgw.png)
8788

@@ -106,7 +107,7 @@ Use /stats — to show statistic
106107

107108
In case you have any questions or need help, please do not hesitate to contact **Ryabina** team by:
108109

109-
* telegram: [@RyabinaValidator](https://t.me/RyabinaValidator)
110-
* [@Acala_Ryabina_bot](https://t.me/Acala_Ryabina_bot)
110+
- telegram: [@RyabinaValidator](https://t.me/RyabinaValidator)
111+
- [@Acala_Ryabina_bot](https://t.me/Acala_Ryabina_bot)
111112

112113
Our Acala address: 5FEoLBq9BP8X3iU6iPmW2KWJahcCazeSaLPd2CamVfdwsCc1

packages/acala/main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { ApiPromise, WsProvider } = require("@polkadot/api")
22
const { options } = require("@acala-network/api")
33
const BigNumber = require("bignumber.js")
4-
const SubstrateBot = require("substratebot")
4+
const SubstrateBot = require("@ryabina/substratebot")
55
const { metaConvertToConfig } = require("substratebot/tools/utils")
66
const { formatBalance } = require("@polkadot/util")
77
const bent = require("bent")
@@ -21,13 +21,13 @@ async function main() {
2121
networkStats = await getNetworkStats(api)
2222
}, 10000)
2323
totalCollaterals = await getAllCollaterals(api)
24-
const substrateBot = new SubstrateBot(
24+
const substrateBot = new SubstrateBot({
2525
settings,
2626
api,
2727
modules,
2828
modes,
29-
getNetworkStatsMessage
30-
)
29+
getNetworkStatsMessage,
30+
})
3131
substrateBot.run()
3232

3333
api.query.system.events(events => {
@@ -484,4 +484,4 @@ this.invalidateCacheInterval = setInterval(() => {
484484
})
485485
}, 60000)
486486

487-
main()
487+
main()

packages/acala/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "acalabot",
2+
"name": "@ryabina/acalabot",
33
"main": "main.js",
44
"version": "1.0.0",
55
"private": true,

0 commit comments

Comments
 (0)