Skip to content

Commit

Permalink
Telegram Notification bot for proposal (#71)
Browse files Browse the repository at this point in the history
* initial commit

* change to testnet

* Add basic working event printing

* notification telegram bot working

* add gitignore

* Remove node_modules folder and update .gitignore

* update config.toml

* removing unused address

* Delete accidentally committed tests/proposal.cairo

* code review changes

* rest of the code-review changes

* Update packages according to code review feedback

* Add error print when unable to send messages to Telegram

* Add automatic retrieval of chain id

* Polish formatting

* Refactor config file reading

* code-review changes in index.ts, package-lock

* Add CI runner

* Trigger CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI

---------

Co-authored-by: Ondřej Sojka <[email protected]>
Co-authored-by: Ondřej Sojka <[email protected]>
  • Loading branch information
3 people authored and Nerrolol committed May 12, 2024
1 parent 04f6801 commit 9f14427
Show file tree
Hide file tree
Showing 7 changed files with 2,563 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/tsc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Typescript

on:
push:
paths:
- '**.ts'
- '.github/'
- 'tsconfig.json'
- 'package.json'
pull_request:
paths:
- '**.ts'
- '.github/'
- 'tsconfig.json'
- 'package.json'

jobs:
compile:
runs-on: ubuntu-latest
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Run tsc
run: cd notification-bot; npm install --save-dev; tsc --project .
21 changes: 20 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,29 @@ Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk

# IDE settings
.vscode

# Environment variables
.env

# Dependency directories
vendor/

# Node.js modules
node_modules/
*.js

# OS files
.DS_Store

# Foundry related
.snfoundry_cache/
account*

# Account-related files that might start with 'account'
account*

# TypeScript files to be ignored
*.tsbuildinfo # TypeScript build information files
dist/ # Common directory for compiled JavaScript files
build/ # Alternative directory for compiled files
15 changes: 15 additions & 0 deletions notification-bot/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[telegram]
bot_api_key = ""
chat_id = ""

[apibara]
url = ""
token = ""

[starknet]
nodeUrl = ""
chain = "sepolia"

[governance]
gov_contract_address = ""
event_selector = "0x01b5f21c50bf3288fb310446824298a349f0ed9e28fb480cc9a4d54d034652e1" # ProposalSubmit
Loading

0 comments on commit 9f14427

Please sign in to comment.