Skip to content

Commit 0813133

Browse files
rootulpcontrotie
andauthored
Add more type definitions to common types (#83)
These are based on smart contract source and https://docs.tokensets.com/ Co-authored-by: Dylan Tran <[email protected]>
1 parent 126a3fb commit 0813133

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

src/types/common.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import { BigNumber } from 'ethers/lib/ethers';
55

66
export { TransactionReceipt } from 'ethereum-types';
77

8+
/**
9+
* SetJSConfig is needed to initialize a new Set instance. SetJSConfig needs an
10+
* Ethereum provider (either ethers or web3). SetJSConfig also needs Set module
11+
* addresses which can be found on
12+
* https://docs.tokensets.com/contracts/deployed/protocol
13+
*/
814
export interface SetJSConfig {
915
ethersProvider?: Provider;
1016
web3Provider?: Web3CoreProvider;
@@ -62,20 +68,61 @@ export type Position = {
6268
};
6369

6470
export type StreamingFeeInfo = {
71+
/**
72+
* Address to accrue fees to
73+
*/
6574
feeRecipient: string;
75+
/**
76+
* Percent of Set accruing to manager annually (1% = 1e16, 100% = 1e18)
77+
*/
6678
streamingFeePercentage: BigNumber;
79+
/**
80+
* The amount of streaming fees that haven't been actualized to the fee receipient yet
81+
*/
6782
unaccruedFees: BigNumber;
6883
};
6984

7085
export type SetDetailsWithStreamingInfo = {
86+
/**
87+
* Set name (e.g. "DeFi Pulse Index")
88+
*/
7189
name: string;
90+
/**
91+
* Set symbol (e.g. "DPI")
92+
*/
7293
symbol: string;
94+
/**
95+
* The address of the set manager
96+
*/
7397
manager: string;
98+
/**
99+
* List of module addresses that have been abled on this set
100+
*/
74101
modules: Address[];
102+
/**
103+
* Status of each module represented as 0, 1, or 2. Every element in this list
104+
* corresponds to an element of the same index in modules.
105+
*
106+
* 0 => NONE
107+
* 1 => PENDING
108+
* 2 => INITIALIZED
109+
*/
75110
moduleStatuses: number[];
111+
/**
112+
* A list of positions that compose this Set
113+
*/
76114
positions: Position[];
115+
/**
116+
* Address to accrue fees to
117+
*/
77118
feeRecipient: string;
119+
/**
120+
* Percent of Set accruing to manager annually (1% = 1e16, 100% = 1e18)
121+
*/
78122
streamingFeePercentage: BigNumber;
123+
/**
124+
* The amount of streaming fees that haven't been actualized to the fee receipient yet
125+
*/
79126
unaccruedFees: BigNumber;
80127
};
81128

0 commit comments

Comments
 (0)