A messenger bot to show BTC/ETH addresses for shared wallet and notify on a channel when payments received. I use it for a swear jar in a Slack channel.
it only supports coinbase as wallet provider and slack as chat provider, feel free to extend it.
- Slack incoming webhook URL
- Coinbase API key/secret
incoming webhook for sending messages is necessary, go to https://api.slack.com/apps and click Create New App
and select your slack room as Development Slack Workspace, then click Create app
.
Click Incoming Webhooks
and activate Incoming Webhooks, click Add New Webhook to Workspace
to get a webhook URL, we will use it later.
We need coinbase api to create a one-time address to receive ETH/BTC. Follow below steps:
- register a coinbase account
- go to
Settings
->API Access
->+ New API Key
- Select two accounts:
BTC Wallet
andETH Wallet
- Select
wallet:accounts:read
,wallet:addresses:create
&wallet:addresses:read
permissions, these 3 permissions can only get your account information & create one-time address for receiving token, should be pretty safe.
Please leave Notification URL
empty, and we will update it later. Create API key and get API key and secret will use it then.
create now.json
in:
src/services/notification/now.json
src/services/notification/now.json
with:
{
"env": {
"COINBASE_API_KEY": "fill your coinbase api key",
"COINBASE_API_SECRET": "fill your coinbase api secret",
"SLACK_WEBHOOK_URL": "fill your slack webhook url"
}
}
$ npm install now -g
$ npm install
$ npm run build
then you will get dist/services/notification/
and dist/services/slash/
ready to deploy to now.sh.
first, login to now.sh service:
$ now login
second, deploy notification and slash to now.sh:
$ now --public dist/services/slash
$ now --public dist/services/notification
each deployment will get a microservice URL. go back to slack app page
-> Slash Commands
and create two command: /jar
& /balance
with slash microservice URL.
and also go to Coinbase API Access
and edit api key to update Notification URL
to notification microservice URL.
go to slack and use /jar
to create a unique address both for BTC & ETH. e.g., user bob
use /jar
will generate two addresses which will be labeled bob
. so when receiving payments via these addresses, a notification will show receive payment from bob
.
There are several ways to contribute to this project:
- Find bug: create an issue in our Github issue tracker.
- Fix a bug: check our issue tracker, leave comments and send a pull request to us to fix a bug.
- Make new feature: leave your idea in the issue tracker and discuss with us then send a pull request!
This project is licensed under the MIT License - see the LICENSE file for details