Skip to content

Latest commit

 

History

History
707 lines (487 loc) · 23.6 KB

DOCS.md

File metadata and controls

707 lines (487 loc) · 23.6 KB

Classes

ExchangeRates
Factory
Pool
Token

ExchangeRates

Kind: global class

new ExchangeRates(signer, exchangeRatesAddress)

Param Type
signer Signer
exchangeRatesAddress string

exchangeRates.rateForCurrency(key) ⇒ Promise.<BigNumber>

Returns the rate for supplied currency.

Kind: instance method of ExchangeRates

Param Type
key string

exchangeRates.getEffectiveValue(source, amount, destination) ⇒ Promise.<BigNumber>

Returns the effective value for source currency amount to the destination currency.

Kind: instance method of ExchangeRates

Param Type
source string
amount BigNumber | string
destination string

Factory

Kind: global class

new Factory(signer, factoryAddress)

Param Type
signer Signer
factoryAddress string

factory.getAddressResolver() ⇒ Promise.<string>

Returns the address resolver of the factory.

Kind: instance method of Factory

factory.getExchangeRates() ⇒ Promise.<ExchangeRates>

Returns an ExchangeRates instance.

Kind: instance method of Factory

factory.getAddress() ⇒ string

Returns the address of the factory contract.

Kind: instance method of Factory

factory.loadPool(address) ⇒ Promise.<Pool>

Loads a pool based on the supplied address. Fails if pool doesn't belong to the given factory.

Kind: instance method of Factory

Param Type
address string

factory.isPool(address) ⇒ Promise.<boolean>

Returns if supplied address is a pool.

Kind: instance method of Factory

Param Type
address string

factory.validatePool(address) ⇒ Promise.<void>

Kind: instance method of Factory

Param Type
address string

factory.getPoolCount(raw) ⇒ Promise.<(number|BigNumber)>

Returns the number of pools in the given factory.

Kind: instance method of Factory

Param Type Default
raw boolean false

factory.getDaoAddress() ⇒ Promise.<string>

Returns the DAO address.

Kind: instance method of Factory

factory.getManagerFee(address, raw) ⇒ Promise.<(number|Array.<BigNumber>)>

Returns tha manager fee of the given pool.

Kind: instance method of Factory

Param Type Default
address string
raw boolean false

factory.getMaximumManagerFee(raw) ⇒ Promise.<(number|Array.<BigNumber>)>

Returns the maximal manager fee in the current factory.

Kind: instance method of Factory

Param Type Default
raw boolean false

factory.getExitFee(raw) ⇒ Promise.<(number|Array.<BigNumber>)>

Returns the exit fee.

Kind: instance method of Factory

Param Type Default
raw boolean false

factory.getDaoFee(raw) ⇒ Promise.<(number|Array.<BigNumber>)>

Returns the DAO fee.

Kind: instance method of Factory

Param Type Default
raw boolean false

factory.getExitFeeCooldown(raw) ⇒ Promise.<(number|BigNumber)>

Returns the exit fee cooldown.

Kind: instance method of Factory

Param Type Default
raw boolean false

factory.getMaximumAssetCount(raw) ⇒ Promise.<(number|BigNumber)>

Returns the maximum number of assets that a pool can support.

Kind: instance method of Factory

Param Type Default
raw boolean false

factory.createPool(privatePool, managerName, poolName, assets, managerFeeNumerator) ⇒ Promise.<Pool>

Creates a pool.

Kind: instance method of Factory

Param Type Default
privatePool boolean
managerName string
poolName string
assets Array.<string>
managerFeeNumerator number | BigNumber 100

Factory.initialize() ⇒ Factory

Initializes a Factory instance based on the .env file.

Kind: static method of Factory

Pool

Kind: global class

new Pool(signer, poolAddress)

Param Type
signer Signer
poolAddress string

pool.token() ⇒ Token

Returns the pool token instance.

Kind: instance method of Pool

pool.getAddress() ⇒ string

Returns the pool address.

Kind: instance method of Pool

pool.getManager() ⇒ Promise.<string>

Returns the pool manager address.

Kind: instance method of Pool

pool.getManagerName() ⇒ Promise.<string>

Returns the pool manager name.

Kind: instance method of Pool

pool.isMember(address) ⇒ Promise.<boolean>

Returns if the supplied address is a pool member.

Kind: instance method of Pool

Param Type
address string

pool.getMembers() ⇒ Promise.<Array.<string>>

Returns all pool member addresses.

Kind: instance method of Pool

pool.getMemberCount(raw) ⇒ Promise.<(number|BigNumber)>

Returns the member count.

Kind: instance method of Pool

Param Default
raw false

pool.changeManager(address, name) ⇒ Promise.<void>

Transfers the manager role to the supplied address with and changes the manager name.

Kind: instance method of Pool

Param Type
address string
name string

pool.addMembers(members) ⇒ Promise.<void>

Batch add members.

Kind: instance method of Pool

Param Type
members Array.<string>

pool.removeMembers(members) ⇒ Promise.<void>

Batch remove members.

Kind: instance method of Pool

Param Type
members Array.<string>

pool.addMember(member) ⇒ Promise.<void>

Add a member.

Kind: instance method of Pool

Param Type
member string

pool.removeMember(member) ⇒ Promise.<void>

Remove a member.

Kind: instance method of Pool

Param Type
member string

pool.isPrivate() ⇒ Promise.<boolean>

Returns if a pool is private

Kind: instance method of Pool

pool.getCreator() ⇒ Promise.<string>

Returns the address of the pool creator.

Kind: instance method of Pool

pool.getCreationTime(raw) ⇒ Promise.<(number|BigNumber)>

Returns the pool creation time.

Kind: instance method of Pool

Param Type Default
raw boolean false

pool.getFactory() ⇒ Promise.<string>

Returns the factory address.

Kind: instance method of Pool

pool.getAssets() ⇒ Promise.<Array.<string>>

Returns all pool assets.

Kind: instance method of Pool

pool.getTokenPriceAtLastFeeMint() ⇒ Promise.<BigNumber>

Returns the last token price at which the manager fee was minted.

Kind: instance method of Pool

pool.getLastDepositByAddress(address, raw) ⇒ Promise.<(number|BigNumber)>

Returns the timestamp of the last deposit of the supplied address.

Kind: instance method of Pool

Param Type Default
address string
raw boolean false

pool.getManagerFee(raw) ⇒ Promise.<(number|BigNumber)>

Returns the manager fee.

Kind: instance method of Pool

Param Type Default
raw boolean false

pool.getExitFee(raw) ⇒ Promise.<(number|BigNumber)>

Returns the exit fee.

Kind: instance method of Pool

Param Type Default
raw boolean false

pool.getAssetCount(raw) ⇒ Promise.<(number|BigNumber)>

Returns the asset count.

Kind: instance method of Pool

Param Type Default
raw boolean false

pool.isAssetSupported(key, convert) ⇒ Promise.<boolean>

Returns true if the asset is supported.

Kind: instance method of Pool

Param Type Default
key string
convert boolean false

pool.getAsset(key) ⇒ Promise.<Token>

Returns the Token instance of the supplied asset.

Kind: instance method of Pool

Param Type
key string

pool.getPoolValue() ⇒ Promise.<BigNumber>

Returns the pool value.

Kind: instance method of Pool

pool.assetValue(key) ⇒ Promise.<BigNumber>

Returns the asset value of the given asset.

Kind: instance method of Pool

Param Type
key string

pool.getSummary() ⇒ Promise.<{exitFee: number, managerFee: number, private: boolean, managerAddress: string, creationTime: number, totalSupply: BigNumber, name: string, managerName: string, totalPoolValue: BigNumber}>

Returns the fund summary

Kind: instance method of Pool

pool.getComposition() ⇒ Promise.<any>

Returns the fund composition.

Kind: instance method of Pool

pool.getWaitingPeriods() ⇒ Promise.<Object>

Returns waiting periods for all assets.

Kind: instance method of Pool

pool.getSuspendedAssets() ⇒ Promise.<Object>

Get a map of suspended assets.

Kind: instance method of Pool

pool.addAsset(key) ⇒ Promise.<void>

Add a supported asset.

Kind: instance method of Pool

Param Type
key string

pool.removeAsset(key) ⇒ Promise.<void>

Remove a supported asset.

Kind: instance method of Pool

Param Type
key string

pool.deposit(amount) ⇒ Promise.<void>

Deposit

Kind: instance method of Pool

Param Type
amount string | BigNumber

pool.withdraw(amount, forfeit) ⇒ Promise.<void>

Withdraw

Kind: instance method of Pool

Param Type Default
amount string | BigNumber
forfeit boolean false

pool.exchange(sourceKey, sourceAmount, destinationKey) ⇒ Promise.<void>

Exchange

Kind: instance method of Pool

Param Type
sourceKey string
sourceAmount string | BigNumber
destinationKey string

Token

Kind: global class

new Token(signer, address)

Param Type
signer Signer
address string

token.getAddress() ⇒ string

Kind: instance method of Token

token.totalSupply() ⇒ Promise.<BigNumber>

Returns the total supply of the token.

Kind: instance method of Token

token.balanceOf(address) ⇒ Promise.<BigNumber>

Returns the balance of the given address.

Kind: instance method of Token

Param Type
address string

token.allowance(owner, spender) ⇒ Promise.<BigNumber>

Returns the allowance of the given owner to the given spender.

Kind: instance method of Token

Param Type
owner string
spender string

token.transfer(recipient, amount) ⇒ Promise.<void>

Transfers the specified amount to the specified recipient

Kind: instance method of Token

Param Type
recipient string
amount BigNumber | string

token.approve(spender, amount) ⇒ Promise.<void>

Approves the allowance to the given spender.

Kind: instance method of Token

Param Type
spender string
amount BigNumber | string

token.transferFrom(sender, recipient, amount) ⇒ Promise.<void>

Transfers from using allowance.

Kind: instance method of Token

Param Type
sender string
recipient string
amount BigNumber | string