Skip to main content

Exports

Table of contents

Namespaces

Classes

Interfaces

Type aliases

Functions

Type aliases

Claim

Ƭ Claim: Object

Type declaration

NameType
drawIdsnumber[]
encodedWinningPickIndicesstring
userAddressstring
winningPickIndicesBigNumber[][]

Defined in

node_modules/@pooltogether/v4-utils-js/dist/types.d.ts:35


Draw

Ƭ Draw: Object

Type declaration

NameType
beaconPeriodSecondsnumber
beaconPeriodStartedAtBigNumber
drawIdnumber
timestampBigNumber
winningRandomNumberBigNumber

Defined in

node_modules/@pooltogether/v4-utils-js/dist/types.d.ts:15


DrawResults

Ƭ DrawResults: Object

Type declaration

NameType
drawIdnumber
prizesPrizeAwardable[]
totalValueBigNumber

Defined in

node_modules/@pooltogether/v4-utils-js/dist/types.d.ts:41


Pick

Ƭ Pick: Object

Type declaration

NameType
hashstring
indexnumber

Defined in

node_modules/@pooltogether/v4-utils-js/dist/types.d.ts:22


PickPrize

Ƭ PickPrize: Object

Type declaration

NameType
amountBigNumber
tierIndexnumber

Defined in

node_modules/@pooltogether/v4-utils-js/dist/types.d.ts:31


Prize

Ƭ Prize: Object

Type declaration

NameType
addressstring
amountBigNumber
pickBigNumber
tiernumber

Defined in

node_modules/@pooltogether/v4-utils-js/dist/types.d.ts:67


PrizeAwardable

Ƭ PrizeAwardable: Object

Type declaration

NameType
amountBigNumber
pickBigNumber
tierIndexnumber

Defined in

node_modules/@pooltogether/v4-utils-js/dist/types.d.ts:26


PrizeDistribution

Ƭ PrizeDistribution: PrizeTier & { endTimestampOffset: number ; matchCardinality: number ; numberOfPicks: BigNumber ; startTimestampOffset: number }

Defined in

node_modules/@pooltogether/v4-utils-js/dist/types.d.ts:9


PrizeTier

Ƭ PrizeTier: Object

Type declaration

NameType
bitRangeSizenumber
expiryDurationnumber
maxPicksPerUsernumber
prizeBigNumber
tiersnumber[]

Defined in

node_modules/@pooltogether/v4-utils-js/dist/types.d.ts:2

Functions

createContract

Const createContract(address, contractInterface, provider): Contract

Parameters

NameType
addressstring
contractInterfaceInterface
providerSigner | Provider

Returns

Contract

Defined in

src/utils/createContract.ts:6


createContractMetadata

createContractMetadata(chainId, address, type, abi, version?, tags?, extensions?): Contract

Parameters

NameTypeDefault value
chainIdnumberundefined
addressstringundefined
typeContractTypeundefined
abiany[]undefined
versionVersionundefined
tagsstring[][]
extensionsObject{}

Returns

Contract

Defined in

src/utils/createContractMetadata.ts:6


createInterface

createInterface(abi): Interface

Parameters

NameType
abiany

Returns

Interface

Defined in

src/utils/createInterface.ts:3


formatTierToBasePercentage

formatTierToBasePercentage(distribution): BigNumber

Parameters

NameType
distributionstring

Returns

BigNumber

Defined in

src/utils/formatTierToBasePercentage.ts:5


getContractListChainIds

getContractListChainIds(contracts): number[]

Parameters

NameType
contractsContract[]

Returns

number[]

Defined in

src/utils/getContractListChainIds.ts:3


getContractsByType

getContractsByType(contracts, type): Contract[]

Parameters

NameType
contractsContract[]
typeContractType

Returns

Contract[]

Defined in

src/utils/getContractsByType.ts:4


getMetadataAndContract

getMetadataAndContract(chainId, signerOrProvider, contractType, contractMetadataList, addressOverride?): Object

Parameters

NameType
chainIdnumber
signerOrProviderSigner | Provider
contractTypeContractType
contractMetadataListContract[]
addressOverride?string

Returns

Object

NameType
contractContract
contractMetadataContract

Defined in

src/utils/getMetadataAndContract.ts:10


getTokenData

getTokenData(tokenContract): Promise<TokenData>

Parameters

NameType
tokenContractContract

Returns

Promise<TokenData>

Defined in

src/utils/contractGetters.ts:7


getUsersERC20Balance

getUsersERC20Balance(usersAddress, tokenContract): Promise<BigNumber>

Parameters

NameType
usersAddressstring
tokenContractContract

Returns

Promise<BigNumber>

Defined in

src/utils/contractGetters.ts:19


getUsersTokenAllowance

getUsersTokenAllowance(usersAddress, spendersAddress, tokenContract): Promise<BigNumber>

Parameters

NameType
usersAddressstring
spendersAddressstring
tokenContractContract

Returns

Promise<BigNumber>

Defined in

src/utils/contractGetters.ts:27


initializePrizeDistributors

initializePrizeDistributors(contractList, signersOrProviders): PrizeDistributor[]

Utility function to create several PrizeDistributors from a contract list.

Parameters

NameTypeDescription
contractListContractLista list of all of the relevant contract metadata for all of the PrizeDistributors to create
signersOrProvidersSignersOrProviderssigners or providers for all of the networks the PrizeDistributors are deployed on keyed by the chain id

Returns

PrizeDistributor[]

a list of PrizeDistributors

Defined in

src/PrizeDistributor.ts:863


initializePrizePools

initializePrizePools(contractList, providers): PrizePool[]

A utility function to create several PrizePools from a contract list.

Parameters

NameTypeDescription
contractListContractLista list of all of the relevant contract metadata for all of the Prize Pools
providersProvidersproviders for all of the networks in the list of Prize Pools

Returns

PrizePool[]

a list of initialized PrizePools

Defined in

src/PrizePool.ts:326


sortContractsByChainId

sortContractsByChainId(contracts): Object

Parameters

NameType
contractsContract[]

Returns

Object

Defined in

src/utils/sortContractsByChainId.ts:3


sortContractsByContractTypeAndChildren

sortContractsByContractTypeAndChildren(contracts, contractType): Contract[][]

Reads the contract list and pulls out connected contracts based on the children extension.

NOTE: This extension is added in the intialize functions for creating the instances of PrizePoolNetwork and PrizeDistributors

Parameters

NameType
contractsContract[]
contractTypeContractType

Returns

Contract[][]

Defined in

src/utils/sortContractsByContractTypeAndChildren.ts:12


validateAddress

validateAddress(errorPrefix, address): void

Throws an error if the provided address is invalid.

Parameters

NameTypeDescription
errorPrefixstringthe class and function name of where the error occurred
addressstringthe address to validate

Returns

void

Defined in

src/utils/validation.ts:10


validateIsSigner

validateIsSigner(errorPrefix, signerOrProvider): void

Throws an error if the signerOrProvider is not a Signer

Parameters

NameTypeDescription
errorPrefixstringthe class and function name of where the error occurred
signerOrProviderSigner | Providera Signer or Provider to check

Returns

void

Defined in

src/utils/validation.ts:37


validateSignerNetwork

validateSignerNetwork(errorPrefix, signer, chainId): Promise<void>

Throws an error if the Signer provided is not on the chain id provided.

Parameters

NameTypeDescription
errorPrefixstringthe class and function name of where the error occurred
signerSignera Signer to validate
chainIdnumberthe network to check for

Returns

Promise<void>

Defined in

src/utils/validation.ts:23


validateSignerOrProviderNetwork

validateSignerOrProviderNetwork(errorPrefix, signerOrProvider, chainId): Promise<void>

Throws and error if the Signer or Provider is not on the chain id provided.

Parameters

NameTypeDescription
errorPrefixstringthe class and function name of where the error occurred
signerOrProviderSigner | Providera Signer or Provider to check
chainIdnumberthe network to check for

Returns

Promise<void>

Defined in

src/utils/validation.ts:49