Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/api3dao/wallet-watcher
Watches and tops up wallets
https://github.com/api3dao/wallet-watcher
Last synced: 2 days ago
JSON representation
Watches and tops up wallets
- Host: GitHub
- URL: https://github.com/api3dao/wallet-watcher
- Owner: api3dao
- License: gpl-3.0
- Created: 2022-08-29T10:26:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-08T13:20:41.000Z (8 months ago)
- Last Synced: 2024-03-09T13:48:26.835Z (8 months ago)
- Language: TypeScript
- Size: 2.18 MB
- Stars: 0
- Watchers: 8
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Wallet Watcher
The wallet watcher loads addresses defined in wallets.json and checks that their balances are not below a defined
threshold. If they are then an alert will be sent to OpsGenie.## Deployment
AWS credentials should be exported as environment variables and both `config/config.json` and `serverless.yml` should be
populated prior to running the following commands:```bash
# Test your installation with
yarn sls invoke local --function wallet-watcher
```With this config in place you can deploy:
```bash
yarn sls:deploy
```Be sure to watch the logs to make sure the applications are behaving as you expect.
## Configuration
### `config.json`
#### `chains`
- `chains..rpc`: The RPC provider URL.
- `opsGenieConfig.apiKey`: The Ops Genie api key.
- `opsGenieConfig.responders[n].team` (optional): The Ops Genie responder type. If left undefined this will be inferred
from the `Ops Genie api key`.
- `opsGenieConfig.responders[n].id` (optional): The Ops Genie responder id. If left undefined this will be inferred from
the `Ops Genie api key`.### `wallets.json`
- `[]`: A list of wallets to check and top up for a chain.
- `[n].walletType`: The type of wallet with the following options:
- `Provider`: the value for the `address` field in the same object is used for top ups.
- `API3`: the value for the `address` field in the same object is used for top ups.
- `Provider-Sponsor`: the destination address is derived from the `sponsor` using the `providerXpub` and `PSP`
protocol id.
- `API3-Sponsor`: the destination address is derived from the `sponsor` using the `API3_XPUB` and PSP protocol id.
- `Airseeker`: the destination address is derived from the `sponsor` using the `providerXpub` and `AIRSEEKER` protocol
id.
- `[n].address` (required only if `walletType` is `Provider` or `API3`): The destination wallet to be used
directly without deriving from the sponsor wallet.
- `[n].name` (optional): The name of the API provider or wallet.
- `[n].providerXpub`: The extended public key of the sponsor address.
- `[n].sponsor`: The sponsor address to derive the destination wallet.
- `[n].lowThreshold.value`: The value used to send an alert if wallet balance is below it.
- `[n].lowThreshold.unit`: The token units used to parse the `lowThreshold.value` for balance check (i.e.
ether, wei, etc).
- `[n].lowThreshold.criticalValue`: The value used to send a _critical_ alert if wallet balance is below it.
This value must be below the `lowThreshold.value` value.