Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.