Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new workflow for updating split weights, along with several other changes to the project configuration and SDK. The most important changes include adding a GitHub Actions workflow, updating package configurations, and implementing new functionalities in the SDK for computing and updating funding weights.
GitHub Actions Workflow:
.github/workflows/distribution.yml
: Added a new workflow to update split weights on push, pull request, and a weekly schedule. This workflow sets up the environment, builds the SDK, and runs theupdate:weights
script.Package Configuration:
package.json
: Added project metadata, scripts for building, linting, and testing, and dependencies for development and runtime.packages/sdk/package.json
: Added SDK-specific configurations, including build scripts and dependencies for TypeScript, Prettier, and various APIs.Environment Variables:
packages/sdk/.env.example
: Added example environment variables required for the SDK operations, such as Supabase, GitHub, Infura, and Splits API keys.SDK Functionalities:
packages/sdk/src/index.ts
: Implemented command-line interface (CLI) commands for populating the database, updating weights, and dispatching emails.packages/sdk/src/metrics/computeWeights.ts
: Added thecomputeWeights
function to calculate funding weights based on metrics fetched from Supabase.packages/sdk/src/metrics/fetchMetricsForPool.ts
: Implemented thefetchMetricsForPool
function to retrieve metrics for a specific funding pool from Supabase.packages/sdk/src/metrics/updateWeights.ts
: Created theupdateWeights
function to update or create splits based on the computed weights and update Supabase accordingly.Utility and Type Definitions:
packages/sdk/src/types.ts
: Defined types for database interactions and utility functions to ensure type safety and consistency across the SDK.packages/sdk/src/utils/client.ts
: Set up clients for Supabase, GitHub, Infura, and Splits API, along with environment variable assertions for secure configurations.