0.1.0 • Published 2 years ago

@losslessproject/twab-delegator-js v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

💻   PoolTogether Delegator Library || PoolTogether V4

Tests Coverage Status ts MIT license npm

Application | Client | Contracts | Documentation | Draw Calculator | Utility Library | Static Cache

🏆   Overview

This library includes a simplified interface for interacting with a v4 PoolTogether TWAB Delegator deployment.

💾   Installation

This project is available as an NPM package:

npm install @pooltogether/v4-twab-delegator-js

or

yarn add @pooltogether/v4-twab-delegator-js

The repo can be cloned from Github for contributions.

git clone https://github.com/pooltogether/v4-twab-delegator-js.git

🏎️   Quickstart

TwabDelegator

A TwabDelegator is a wrapper on an ethers Contract with utility functions.

To create an instance of TwabDelegator you will need:

import { TwabDelegator, deployments } from '@pooltogether/v4-twab-delegator-js'
import { mainnet } from '@pooltogether/v4-pool-data'

const provider = getProvider(CHAIN_ID.mainnet)
const delegator = new TwabDelegator(provider, deployments[CHAIN_ID.mainnet])

NOTE: This interface will change in the future. A chain id is not a sufficient key once the protocol expands to multiple Prize Pools.

ESLint

The TSDX linting configuration is overwritten to include override(s)* for:

  • Import/Order (used to enforce consistent module import ordering)
*The ESLint overrides may incorrectly be interpreted by VSCode since the nested config file is ignored in the IDE

Porting docs to PoolTogether V4 Docs

  1. yarn docs
  2. Copy & paste
  • classes to Classes
  • interfaces to Interfaces
  • README.md below header to index.md
  1. Replace all .md with (nothing) in links
  2. Replace all README links to ./ and ../README to ../