Skip to content

Commit

Permalink
Merge pull request #7 from LIT-Protocol/multinetwork-auto-top-up-final
Browse files Browse the repository at this point in the history
Multi-network Auto-top up documentation
  • Loading branch information
MaximusHaximus authored Jul 23, 2024
2 parents c6427d7 + 2d78c67 commit b6c2226
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 33 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This repo provides scaffolding for running internal scheduled tasks on a CRON-like schedule.

### If you need to add an account to receive auto-top-up rate limit NFTs, see the [worker readme](./worker/README.md)

## ❌ Installation

Packages in this repository are currently not published to NPM; it is expected to be deployed as a worker to Heroku.
Expand Down
7 changes: 2 additions & 5 deletions bin/validateJSONRecipients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import { recipientDetailSchema } from 'lit-task-auto-top-up';
// eslint-disable-next-line import/no-extraneous-dependencies
import { z } from 'zod';

// TODO: Delete this file and reference once PR #5 is merged and the existing worker has been updated to use the new habanero-specific path
import deprecatedHabaneroRecipientList from '../worker/recipient_list.json' assert { type: 'json' };
import habanberoRecipientList from '../worker/recipient_list_habanero.json' assert { type: 'json' };
import habaneroRecipientList from '../worker/recipient_list_habanero.json' assert { type: 'json' };
import manzanoRecipientList from '../worker/recipient_list_manzano.json' assert { type: 'json' };

z.array(recipientDetailSchema).parse(deprecatedHabaneroRecipientList);
z.array(recipientDetailSchema).parse(habanberoRecipientList);
z.array(recipientDetailSchema).parse(habaneroRecipientList);
z.array(recipientDetailSchema).parse(manzanoRecipientList);
2 changes: 1 addition & 1 deletion packages/lit-task-auto-top-up/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const DEFAULT_RECIPIENT_LIST_URL =
'https://raw.githubusercontent.com/LIT-Protocol/lit-scheduled-tasks/blob/main/worker/recipient_list.json';
'https://raw.githubusercontent.com/LIT-Protocol/lit-scheduled-tasks/main/worker/recipient_list_habanero.json';
export const taskName = 'top-up capacity credits';
20 changes: 20 additions & 0 deletions worker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 🔥 LIT Scheduled Tasks Worker 🔧

Adding a recipient for auto-top-up is done by opening a pull request that adds your account and token details to the appropriate file in this directory.
There is 1 file per supported network:

### [Habanero](./recipient_list_habanero.json)

### [Manzano](./recipient_list_manzano.json)

Note that entries must match the following shape:

```json
{
"daysUntilExpires": 10,
"recipientAddress": "<your PKP address here>",
"requestsPerSecond": 10
}
```

`recipientAddress` is required. `daysUntilExpires` and `requestsPerSecond` are optional, and will default to `10` if you do not provide them.
27 changes: 0 additions & 27 deletions worker/recipient_list.json

This file was deleted.

0 comments on commit b6c2226

Please sign in to comment.