@raac/rpc 2.0.0-beta.6 → 2.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/RPCLibrary.js +27 -2
  2. package/dist/artifacts/core/collectors/fee-streamer/RentStreamer.sol/RentStreamer.json +838 -0
  3. package/dist/artifacts/mocks/core/tokens/USDCTokenLimited.sol/USDCTokenLimited.json +558 -0
  4. package/dist/configs/chains/11155111.json +58 -3
  5. package/dist/contracts/curve/common/_helpers.js +39 -0
  6. package/dist/contracts/curve/common/getPools.js +36 -0
  7. package/dist/contracts/curve/common/getVirtualPrice.js +26 -0
  8. package/dist/contracts/curve/common/index.js +18 -0
  9. package/dist/contracts/findContract.js +3 -3
  10. package/dist/contracts/getContractAddress.js +1 -0
  11. package/dist/contracts/governance/gaugeSystems/_helpers.js +2 -2
  12. package/dist/contracts/rentStreamer/_helpers.js +19 -0
  13. package/dist/contracts/rentStreamer/getScheduled.js +19 -0
  14. package/dist/contracts/rentStreamer/getState.js +40 -0
  15. package/dist/contracts/rentStreamer/previewRelease.js +23 -0
  16. package/dist/contracts/rentStreamer/release.js +22 -0
  17. package/dist/contracts/rentStreamer/sync.js +21 -0
  18. package/dist/pools/lendingPool/adapters/erc20/getERC20AdapterBalance.js +4 -4
  19. package/dist/types/RPCLibrary.d.ts +20 -1
  20. package/dist/types/contracts/curve/common/_helpers.d.ts +16 -0
  21. package/dist/types/contracts/curve/common/getPools.d.ts +30 -0
  22. package/dist/types/contracts/curve/common/getVirtualPrice.d.ts +13 -0
  23. package/dist/types/contracts/curve/common/index.d.ts +2 -0
  24. package/dist/types/contracts/rentStreamer/_helpers.d.ts +4 -0
  25. package/dist/types/contracts/rentStreamer/getScheduled.d.ts +12 -0
  26. package/dist/types/contracts/rentStreamer/getState.d.ts +33 -0
  27. package/dist/types/contracts/rentStreamer/previewRelease.d.ts +20 -0
  28. package/dist/types/contracts/rentStreamer/release.d.ts +12 -0
  29. package/dist/types/contracts/rentStreamer/sync.d.ts +11 -0
  30. package/dist/types/pools/lendingPool/adapters/erc20/getERC20AdapterBalance.d.ts +3 -3
  31. package/dist/types/typechain-types/contracts/core/collectors/fee-streamer/RentStreamer.d.ts +422 -0
  32. package/dist/types/typechain-types/contracts/core/collectors/fee-streamer/index.d.ts +1 -0
  33. package/dist/types/typechain-types/contracts/core/collectors/index.d.ts +2 -0
  34. package/dist/types/typechain-types/contracts/mocks/core/tokens/USDCTokenLimited.d.ts +238 -0
  35. package/dist/types/typechain-types/contracts/mocks/core/tokens/index.d.ts +1 -0
  36. package/dist/types/typechain-types/factories/contracts/core/collectors/fee-streamer/RentStreamer__factory.d.ts +665 -0
  37. package/dist/types/typechain-types/factories/contracts/core/collectors/fee-streamer/index.d.ts +1 -0
  38. package/dist/types/typechain-types/factories/contracts/core/collectors/index.d.ts +1 -0
  39. package/dist/types/typechain-types/factories/contracts/mocks/core/tokens/USDCTokenLimited__factory.d.ts +439 -0
  40. package/dist/types/typechain-types/factories/contracts/mocks/core/tokens/index.d.ts +1 -0
  41. package/dist/types/typechain-types/index.d.ts +4 -0
  42. package/dist/types/user/_helpers.d.ts +23 -0
  43. package/dist/types/user/computeEffectiveReturn.d.ts +67 -0
  44. package/dist/types/user/getUserClaimables.d.ts +55 -0
  45. package/dist/types/user/getUserCollateral.d.ts +12 -0
  46. package/dist/types/user/getUserDebt.d.ts +18 -0
  47. package/dist/types/user/getUserFarming.d.ts +64 -0
  48. package/dist/types/user/getUserGovernance.d.ts +20 -0
  49. package/dist/types/user/getUserPortfolio.d.ts +61 -0
  50. package/dist/types/user/getUserWalletBalances.d.ts +20 -0
  51. package/dist/types/user/index.d.ts +9 -0
  52. package/dist/types/utils/amount.d.ts +7 -0
  53. package/dist/types/utils/artifacts.d.ts +198 -0
  54. package/dist/types/utils/contracts.d.ts +2 -0
  55. package/dist/user/_helpers.js +22 -0
  56. package/dist/user/computeEffectiveReturn.js +33 -0
  57. package/dist/user/getUserClaimables.js +97 -0
  58. package/dist/user/getUserCollateral.js +29 -0
  59. package/dist/user/getUserDebt.js +32 -0
  60. package/dist/user/getUserFarming.js +100 -0
  61. package/dist/user/getUserGovernance.js +35 -0
  62. package/dist/user/getUserPortfolio.js +109 -0
  63. package/dist/user/getUserWalletBalances.js +30 -0
  64. package/dist/user/index.js +24 -0
  65. package/dist/utils/amount.js +10 -0
  66. package/dist/utils/artifacts.js +4 -0
  67. package/dist/utils/contracts.js +5 -2
  68. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  export * as nftRoyaltyFeeCollectorSol from "./NFTRoyaltyFeeCollector.sol";
2
+ export * as feeStreamer from "./fee-streamer";
2
3
  export { ERC20Collector__factory } from "./ERC20Collector__factory";
3
4
  export { FeeCollector__factory } from "./FeeCollector__factory";
4
5
  export { RAACTokenCollector__factory } from "./RAACTokenCollector__factory";
@@ -0,0 +1,439 @@
1
+ import { ContractFactory, ContractTransactionResponse } from "ethers";
2
+ import type { Signer, AddressLike, ContractDeployTransaction, ContractRunner } from "ethers";
3
+ import type { NonPayableOverrides } from "../../../../../common";
4
+ import type { USDCTokenLimited, USDCTokenLimitedInterface } from "../../../../../contracts/mocks/core/tokens/USDCTokenLimited";
5
+ type USDCTokenLimitedConstructorParams = [signer?: Signer] | ConstructorParameters<typeof ContractFactory>;
6
+ export declare class USDCTokenLimited__factory extends ContractFactory {
7
+ constructor(...args: USDCTokenLimitedConstructorParams);
8
+ getDeployTransaction(name: string, symbol: string, initialOwner: AddressLike, overrides?: NonPayableOverrides & {
9
+ from?: string;
10
+ }): Promise<ContractDeployTransaction>;
11
+ deploy(name: string, symbol: string, initialOwner: AddressLike, overrides?: NonPayableOverrides & {
12
+ from?: string;
13
+ }): Promise<USDCTokenLimited & {
14
+ deploymentTransaction(): ContractTransactionResponse;
15
+ }>;
16
+ connect(runner: ContractRunner | null): USDCTokenLimited__factory;
17
+ static readonly bytecode = "0x6080604052346103c85761102180380380610019816103cc565b9283398101906060818303126103c85780516001600160401b0381116103c857826100459183016103f1565b60208201519092906001600160401b0381116103c8576040916100699184016103f1565b9101516001600160a01b038116908190036103c85782516001600160401b0381116102d957600354600181811c911680156103be575b60208210146102bb57601f811161035b575b506020601f82116001146102f857819293945f926102ed575b50508160011b915f199060031b1c1916176003555b81516001600160401b0381116102d957600454600181811c911680156102cf575b60208210146102bb57601f8111610258575b50602092601f82116001146101f757928192935f926101ec575b50508160011b915f199060031b1c1916176004555b80156101d957600580546001600160a01b031981168317909155604051919081906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a38060018060a01b03196006541617600655692a5a058fc295ed0000006007555f52600860205260405f20600160ff19825416179055642e90edd000600755610bc6908161045b8239f35b631e4fbdf760e01b5f525f60045260245ffd5b015190505f8061012c565b601f1982169360045f52805f20915f5b8681106102405750836001959610610228575b505050811b01600455610141565b01515f1960f88460031b161c191690555f808061021a565b91926020600181928685015181550194019201610207565b60045f527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f830160051c810191602084106102b1575b601f0160051c01905b8181106102a65750610112565b5f8155600101610299565b9091508190610290565b634e487b7160e01b5f52602260045260245ffd5b90607f1690610100565b634e487b7160e01b5f52604160045260245ffd5b015190505f806100ca565b601f1982169060035f52805f20915f5b8181106103435750958360019596971061032b575b505050811b016003556100df565b01515f1960f88460031b161c191690555f808061031d565b9192602060018192868b015181550194019201610308565b60035f527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b601f830160051c810191602084106103b4575b601f0160051c01905b8181106103a957506100b1565b5f815560010161039c565b9091508190610393565b90607f169061009f565b5f80fd5b6040519190601f01601f191682016001600160401b038111838210176102d957604052565b81601f820112156103c8578051906001600160401b0382116102d957610420601f8301601f19166020016103cc565b92828452602083830101116103c8575f5b82811061044557505060205f918301015290565b8060208092840101518282870101520161043156fe6080806040526004361015610012575f80fd5b5f3560e01c9081623d4790146107d55750806306fdde031461070357806307546172146106db578063095ea7b3146106b557806318160ddd1461069857806323b872dd146105b9578063313ce5671461059e57806337d651211461058157806340c10f191461055c57806342966c681461053f57806370a0823114610508578063715018a6146104c057806379cc6790146104105780638da5cb5b146103e857806395d89b41146102cd578063a9059cbb1461029c578063d936547e1461025f578063dd62ed3e1461020f578063f2fde38b1461019c578063f59c3708146101495763fca3b5aa14610102575f80fd5b346101455760203660031901126101455761011b610809565b610123610ac6565b600680546001600160a01b0319166001600160a01b0392909216919091179055005b5f80fd5b3461014557604036600319011261014557610162610809565b6024359081151580920361014557610178610ac6565b60018060a01b03165f52600860205260405f209060ff801983541691161790555f80f35b34610145576020366003190112610145576101b5610809565b6101bd610ac6565b6001600160a01b031680156101fc57600580546001600160a01b0319811683179091556001600160a01b03165f516020610b515f395f51905f525f80a3005b631e4fbdf760e01b5f525f60045260245ffd5b3461014557604036600319011261014557610228610809565b61023061081f565b6001600160a01b039182165f908152600160209081526040808320949093168252928352819020549051908152f35b34610145576020366003190112610145576001600160a01b03610280610809565b165f526008602052602060ff60405f2054166040519015158152f35b34610145576040366003190112610145576102c26102b8610809565b6024359033610961565b602060405160018152f35b34610145575f366003190112610145576040515f6004548060011c906001811680156103de575b6020831081146103ca578285529081156103ae5750600114610358575b50819003601f01601f19168101906001600160401b038211818310176103445761034082918260405282610835565b0390f35b634e487b7160e01b5f52604160045260245ffd5b60045f9081529091507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b82821061039857506020915082010182610311565b6001816020925483858801015201910190610383565b90506020925060ff191682840152151560051b82010182610311565b634e487b7160e01b5f52602260045260245ffd5b91607f16916102f4565b34610145575f366003190112610145576005546040516001600160a01b039091168152602090f35b3461014557604036600319011261014557610429610809565b6001600160a01b0381165f908152600160209081526040808320338452909152902054906024359081831061046f576104688261046d94033383610aed565b610a55565b005b60405162461bcd60e51b8152602060048201526024808201527f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f77604482015263616e636560e01b6064820152608490fd5b34610145575f366003190112610145576104d8610ac6565b600580546001600160a01b031981169091555f906001600160a01b03165f516020610b515f395f51905f528280a3005b34610145576020366003190112610145576001600160a01b03610529610809565b165f525f602052602060405f2054604051908152f35b346101455760203660031901126101455761046d60043533610a55565b346101455760403660031901126101455761046d610578610809565b6024359061089d565b34610145575f366003190112610145576020600754604051908152f35b34610145575f36600319011261014557602060405160068152f35b34610145576060366003190112610145576105d2610809565b6105da61081f565b6001600160a01b0382165f818152600160209081526040808320338452909152902054909260443592915f198110610618575b506102c29350610961565b83811061067d57841561066a573315610657576102c2945f52600160205260405f2060018060a01b0333165f526020528360405f20910390558461060d565b634a1406b160e11b5f525f60045260245ffd5b63e602df0560e01b5f525f60045260245ffd5b8390637dc7a0d960e11b5f523360045260245260445260645ffd5b34610145575f366003190112610145576020600254604051908152f35b34610145576040366003190112610145576102c26106d1610809565b6024359033610aed565b34610145575f366003190112610145576006546040516001600160a01b039091168152602090f35b34610145575f366003190112610145576040515f6003548060011c906001811680156107cb575b6020831081146103ca578285529081156103ae57506001146107755750819003601f01601f19168101906001600160401b038211818310176103445761034082918260405282610835565b60035f9081529091507fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8282106107b557506020915082010182610311565b60018160209254838588010152019101906107a0565b91607f169161072a565b34610145576020366003190112610145576020906001600160a01b036107f9610809565b165f526009825260405f20548152f35b600435906001600160a01b038216820361014557565b602435906001600160a01b038216820361014557565b9190916020815282518060208301525f5b818110610866575060409293505f838284010152601f8019910116010190565b8060208092870101516040828601015201610846565b9190820180921161088957565b634e487b7160e01b5f52601160045260245ffd5b90335f52600860205260ff60405f20541661093857506001600160a01b0381165f818152600960205260409020546108f6576108dc6007548093610a0b565b5f5260096020526108f260405f2091825461087c565b9055565b60405162461bcd60e51b815260206004820152601a6024820152791059191c995cdcc81a185cc8185b1c9958591e481b5a5b9d195960321b6044820152606490fd5b906109438282610a0b565b60018060a01b03165f5260096020526108f260405f2091825461087c565b6001600160a01b03169081156109f8576001600160a01b03169182156109e557815f525f60205260405f20548181106109cc57815f516020610b715f395f51905f5292602092855f525f84520360405f2055845f525f825260405f20818154019055604051908152a3565b8263391434e360e21b5f5260045260245260445260645ffd5b63ec442f0560e01b5f525f60045260245ffd5b634b637e8f60e11b5f525f60045260245ffd5b6001600160a01b03169081156109e5575f516020610b715f395f51905f52602082610a395f9460025461087c565b60025584845283825260408420818154019055604051908152a3565b9091906001600160a01b031680156109f857805f525f60205260405f2054838110610aac576020845f94955f516020610b715f395f51905f52938587528684520360408620558060025403600255604051908152a3565b915063391434e360e21b5f5260045260245260445260645ffd5b6005546001600160a01b03163303610ada57565b63118cdaa760e01b5f523360045260245ffd5b6001600160a01b031690811561066a576001600160a01b03169182156106575760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591835f526001825260405f20855f5282528060405f2055604051908152a356fe8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212204289982fcf7a140f0becfd824954d196a7976fa4365850643ed469ba6e7168f564736f6c634300081e0033";
18
+ static readonly abi: readonly [{
19
+ readonly inputs: readonly [{
20
+ readonly internalType: "string";
21
+ readonly name: "name";
22
+ readonly type: "string";
23
+ }, {
24
+ readonly internalType: "string";
25
+ readonly name: "symbol";
26
+ readonly type: "string";
27
+ }, {
28
+ readonly internalType: "address";
29
+ readonly name: "initialOwner";
30
+ readonly type: "address";
31
+ }];
32
+ readonly stateMutability: "nonpayable";
33
+ readonly type: "constructor";
34
+ }, {
35
+ readonly inputs: readonly [{
36
+ readonly internalType: "address";
37
+ readonly name: "spender";
38
+ readonly type: "address";
39
+ }, {
40
+ readonly internalType: "uint256";
41
+ readonly name: "allowance";
42
+ readonly type: "uint256";
43
+ }, {
44
+ readonly internalType: "uint256";
45
+ readonly name: "needed";
46
+ readonly type: "uint256";
47
+ }];
48
+ readonly name: "ERC20InsufficientAllowance";
49
+ readonly type: "error";
50
+ }, {
51
+ readonly inputs: readonly [{
52
+ readonly internalType: "address";
53
+ readonly name: "sender";
54
+ readonly type: "address";
55
+ }, {
56
+ readonly internalType: "uint256";
57
+ readonly name: "balance";
58
+ readonly type: "uint256";
59
+ }, {
60
+ readonly internalType: "uint256";
61
+ readonly name: "needed";
62
+ readonly type: "uint256";
63
+ }];
64
+ readonly name: "ERC20InsufficientBalance";
65
+ readonly type: "error";
66
+ }, {
67
+ readonly inputs: readonly [{
68
+ readonly internalType: "address";
69
+ readonly name: "approver";
70
+ readonly type: "address";
71
+ }];
72
+ readonly name: "ERC20InvalidApprover";
73
+ readonly type: "error";
74
+ }, {
75
+ readonly inputs: readonly [{
76
+ readonly internalType: "address";
77
+ readonly name: "receiver";
78
+ readonly type: "address";
79
+ }];
80
+ readonly name: "ERC20InvalidReceiver";
81
+ readonly type: "error";
82
+ }, {
83
+ readonly inputs: readonly [{
84
+ readonly internalType: "address";
85
+ readonly name: "sender";
86
+ readonly type: "address";
87
+ }];
88
+ readonly name: "ERC20InvalidSender";
89
+ readonly type: "error";
90
+ }, {
91
+ readonly inputs: readonly [{
92
+ readonly internalType: "address";
93
+ readonly name: "spender";
94
+ readonly type: "address";
95
+ }];
96
+ readonly name: "ERC20InvalidSpender";
97
+ readonly type: "error";
98
+ }, {
99
+ readonly inputs: readonly [{
100
+ readonly internalType: "address";
101
+ readonly name: "owner";
102
+ readonly type: "address";
103
+ }];
104
+ readonly name: "OwnableInvalidOwner";
105
+ readonly type: "error";
106
+ }, {
107
+ readonly inputs: readonly [{
108
+ readonly internalType: "address";
109
+ readonly name: "account";
110
+ readonly type: "address";
111
+ }];
112
+ readonly name: "OwnableUnauthorizedAccount";
113
+ readonly type: "error";
114
+ }, {
115
+ readonly anonymous: false;
116
+ readonly inputs: readonly [{
117
+ readonly indexed: true;
118
+ readonly internalType: "address";
119
+ readonly name: "owner";
120
+ readonly type: "address";
121
+ }, {
122
+ readonly indexed: true;
123
+ readonly internalType: "address";
124
+ readonly name: "spender";
125
+ readonly type: "address";
126
+ }, {
127
+ readonly indexed: false;
128
+ readonly internalType: "uint256";
129
+ readonly name: "value";
130
+ readonly type: "uint256";
131
+ }];
132
+ readonly name: "Approval";
133
+ readonly type: "event";
134
+ }, {
135
+ readonly anonymous: false;
136
+ readonly inputs: readonly [{
137
+ readonly indexed: true;
138
+ readonly internalType: "address";
139
+ readonly name: "previousOwner";
140
+ readonly type: "address";
141
+ }, {
142
+ readonly indexed: true;
143
+ readonly internalType: "address";
144
+ readonly name: "newOwner";
145
+ readonly type: "address";
146
+ }];
147
+ readonly name: "OwnershipTransferred";
148
+ readonly type: "event";
149
+ }, {
150
+ readonly anonymous: false;
151
+ readonly inputs: readonly [{
152
+ readonly indexed: true;
153
+ readonly internalType: "address";
154
+ readonly name: "from";
155
+ readonly type: "address";
156
+ }, {
157
+ readonly indexed: true;
158
+ readonly internalType: "address";
159
+ readonly name: "to";
160
+ readonly type: "address";
161
+ }, {
162
+ readonly indexed: false;
163
+ readonly internalType: "uint256";
164
+ readonly name: "value";
165
+ readonly type: "uint256";
166
+ }];
167
+ readonly name: "Transfer";
168
+ readonly type: "event";
169
+ }, {
170
+ readonly inputs: readonly [{
171
+ readonly internalType: "address";
172
+ readonly name: "owner";
173
+ readonly type: "address";
174
+ }, {
175
+ readonly internalType: "address";
176
+ readonly name: "spender";
177
+ readonly type: "address";
178
+ }];
179
+ readonly name: "allowance";
180
+ readonly outputs: readonly [{
181
+ readonly internalType: "uint256";
182
+ readonly name: "";
183
+ readonly type: "uint256";
184
+ }];
185
+ readonly stateMutability: "view";
186
+ readonly type: "function";
187
+ }, {
188
+ readonly inputs: readonly [{
189
+ readonly internalType: "address";
190
+ readonly name: "spender";
191
+ readonly type: "address";
192
+ }, {
193
+ readonly internalType: "uint256";
194
+ readonly name: "value";
195
+ readonly type: "uint256";
196
+ }];
197
+ readonly name: "approve";
198
+ readonly outputs: readonly [{
199
+ readonly internalType: "bool";
200
+ readonly name: "";
201
+ readonly type: "bool";
202
+ }];
203
+ readonly stateMutability: "nonpayable";
204
+ readonly type: "function";
205
+ }, {
206
+ readonly inputs: readonly [{
207
+ readonly internalType: "address";
208
+ readonly name: "account";
209
+ readonly type: "address";
210
+ }];
211
+ readonly name: "balanceOf";
212
+ readonly outputs: readonly [{
213
+ readonly internalType: "uint256";
214
+ readonly name: "";
215
+ readonly type: "uint256";
216
+ }];
217
+ readonly stateMutability: "view";
218
+ readonly type: "function";
219
+ }, {
220
+ readonly inputs: readonly [{
221
+ readonly internalType: "uint256";
222
+ readonly name: "amount";
223
+ readonly type: "uint256";
224
+ }];
225
+ readonly name: "burn";
226
+ readonly outputs: readonly [];
227
+ readonly stateMutability: "nonpayable";
228
+ readonly type: "function";
229
+ }, {
230
+ readonly inputs: readonly [{
231
+ readonly internalType: "address";
232
+ readonly name: "account";
233
+ readonly type: "address";
234
+ }, {
235
+ readonly internalType: "uint256";
236
+ readonly name: "amount";
237
+ readonly type: "uint256";
238
+ }];
239
+ readonly name: "burnFrom";
240
+ readonly outputs: readonly [];
241
+ readonly stateMutability: "nonpayable";
242
+ readonly type: "function";
243
+ }, {
244
+ readonly inputs: readonly [];
245
+ readonly name: "decimals";
246
+ readonly outputs: readonly [{
247
+ readonly internalType: "uint8";
248
+ readonly name: "";
249
+ readonly type: "uint8";
250
+ }];
251
+ readonly stateMutability: "pure";
252
+ readonly type: "function";
253
+ }, {
254
+ readonly inputs: readonly [];
255
+ readonly name: "maxMintablePerAddress";
256
+ readonly outputs: readonly [{
257
+ readonly internalType: "uint256";
258
+ readonly name: "";
259
+ readonly type: "uint256";
260
+ }];
261
+ readonly stateMutability: "view";
262
+ readonly type: "function";
263
+ }, {
264
+ readonly inputs: readonly [{
265
+ readonly internalType: "address";
266
+ readonly name: "to";
267
+ readonly type: "address";
268
+ }, {
269
+ readonly internalType: "uint256";
270
+ readonly name: "amount";
271
+ readonly type: "uint256";
272
+ }];
273
+ readonly name: "mint";
274
+ readonly outputs: readonly [];
275
+ readonly stateMutability: "nonpayable";
276
+ readonly type: "function";
277
+ }, {
278
+ readonly inputs: readonly [];
279
+ readonly name: "minter";
280
+ readonly outputs: readonly [{
281
+ readonly internalType: "address";
282
+ readonly name: "";
283
+ readonly type: "address";
284
+ }];
285
+ readonly stateMutability: "view";
286
+ readonly type: "function";
287
+ }, {
288
+ readonly inputs: readonly [];
289
+ readonly name: "name";
290
+ readonly outputs: readonly [{
291
+ readonly internalType: "string";
292
+ readonly name: "";
293
+ readonly type: "string";
294
+ }];
295
+ readonly stateMutability: "view";
296
+ readonly type: "function";
297
+ }, {
298
+ readonly inputs: readonly [];
299
+ readonly name: "owner";
300
+ readonly outputs: readonly [{
301
+ readonly internalType: "address";
302
+ readonly name: "";
303
+ readonly type: "address";
304
+ }];
305
+ readonly stateMutability: "view";
306
+ readonly type: "function";
307
+ }, {
308
+ readonly inputs: readonly [];
309
+ readonly name: "renounceOwnership";
310
+ readonly outputs: readonly [];
311
+ readonly stateMutability: "nonpayable";
312
+ readonly type: "function";
313
+ }, {
314
+ readonly inputs: readonly [{
315
+ readonly internalType: "address";
316
+ readonly name: "_minter";
317
+ readonly type: "address";
318
+ }];
319
+ readonly name: "setMinter";
320
+ readonly outputs: readonly [];
321
+ readonly stateMutability: "nonpayable";
322
+ readonly type: "function";
323
+ }, {
324
+ readonly inputs: readonly [];
325
+ readonly name: "symbol";
326
+ readonly outputs: readonly [{
327
+ readonly internalType: "string";
328
+ readonly name: "";
329
+ readonly type: "string";
330
+ }];
331
+ readonly stateMutability: "view";
332
+ readonly type: "function";
333
+ }, {
334
+ readonly inputs: readonly [{
335
+ readonly internalType: "address";
336
+ readonly name: "";
337
+ readonly type: "address";
338
+ }];
339
+ readonly name: "totalMinted";
340
+ readonly outputs: readonly [{
341
+ readonly internalType: "uint256";
342
+ readonly name: "";
343
+ readonly type: "uint256";
344
+ }];
345
+ readonly stateMutability: "view";
346
+ readonly type: "function";
347
+ }, {
348
+ readonly inputs: readonly [];
349
+ readonly name: "totalSupply";
350
+ readonly outputs: readonly [{
351
+ readonly internalType: "uint256";
352
+ readonly name: "";
353
+ readonly type: "uint256";
354
+ }];
355
+ readonly stateMutability: "view";
356
+ readonly type: "function";
357
+ }, {
358
+ readonly inputs: readonly [{
359
+ readonly internalType: "address";
360
+ readonly name: "to";
361
+ readonly type: "address";
362
+ }, {
363
+ readonly internalType: "uint256";
364
+ readonly name: "value";
365
+ readonly type: "uint256";
366
+ }];
367
+ readonly name: "transfer";
368
+ readonly outputs: readonly [{
369
+ readonly internalType: "bool";
370
+ readonly name: "";
371
+ readonly type: "bool";
372
+ }];
373
+ readonly stateMutability: "nonpayable";
374
+ readonly type: "function";
375
+ }, {
376
+ readonly inputs: readonly [{
377
+ readonly internalType: "address";
378
+ readonly name: "from";
379
+ readonly type: "address";
380
+ }, {
381
+ readonly internalType: "address";
382
+ readonly name: "to";
383
+ readonly type: "address";
384
+ }, {
385
+ readonly internalType: "uint256";
386
+ readonly name: "value";
387
+ readonly type: "uint256";
388
+ }];
389
+ readonly name: "transferFrom";
390
+ readonly outputs: readonly [{
391
+ readonly internalType: "bool";
392
+ readonly name: "";
393
+ readonly type: "bool";
394
+ }];
395
+ readonly stateMutability: "nonpayable";
396
+ readonly type: "function";
397
+ }, {
398
+ readonly inputs: readonly [{
399
+ readonly internalType: "address";
400
+ readonly name: "newOwner";
401
+ readonly type: "address";
402
+ }];
403
+ readonly name: "transferOwnership";
404
+ readonly outputs: readonly [];
405
+ readonly stateMutability: "nonpayable";
406
+ readonly type: "function";
407
+ }, {
408
+ readonly inputs: readonly [{
409
+ readonly internalType: "address";
410
+ readonly name: "account";
411
+ readonly type: "address";
412
+ }, {
413
+ readonly internalType: "bool";
414
+ readonly name: "isWhitelisted";
415
+ readonly type: "bool";
416
+ }];
417
+ readonly name: "whitelist";
418
+ readonly outputs: readonly [];
419
+ readonly stateMutability: "nonpayable";
420
+ readonly type: "function";
421
+ }, {
422
+ readonly inputs: readonly [{
423
+ readonly internalType: "address";
424
+ readonly name: "";
425
+ readonly type: "address";
426
+ }];
427
+ readonly name: "whitelisted";
428
+ readonly outputs: readonly [{
429
+ readonly internalType: "bool";
430
+ readonly name: "";
431
+ readonly type: "bool";
432
+ }];
433
+ readonly stateMutability: "view";
434
+ readonly type: "function";
435
+ }];
436
+ static createInterface(): USDCTokenLimitedInterface;
437
+ static connect(address: string, runner?: ContractRunner | null): USDCTokenLimited;
438
+ }
439
+ export {};
@@ -8,3 +8,4 @@ export { MockUSDC__factory } from "./MockUSDC__factory";
8
8
  export { RAACMockERC20__factory } from "./RAACMockERC20__factory";
9
9
  export { CrvUSDToken__factory } from "./CrvUSDToken__factory";
10
10
  export { CrvUSDTokenLimited__factory } from "./CrvUSDTokenLimited__factory";
11
+ export { USDCTokenLimited__factory } from "./USDCTokenLimited__factory";
@@ -159,6 +159,8 @@ export type { NFTRoyaltyFeeCollector } from "./contracts/core/collectors/NFTRoya
159
159
  export { NFTRoyaltyFeeCollector__factory } from "./factories/contracts/core/collectors/NFTRoyaltyFeeCollector.sol/NFTRoyaltyFeeCollector__factory";
160
160
  export type { RAACTokenCollector } from "./contracts/core/collectors/RAACTokenCollector";
161
161
  export { RAACTokenCollector__factory } from "./factories/contracts/core/collectors/RAACTokenCollector__factory";
162
+ export type { RentStreamer } from "./contracts/core/collectors/fee-streamer/RentStreamer";
163
+ export { RentStreamer__factory } from "./factories/contracts/core/collectors/fee-streamer/RentStreamer__factory";
162
164
  export type { RWAIndexTokenCollector } from "./contracts/core/collectors/RWAIndexTokenCollector";
163
165
  export { RWAIndexTokenCollector__factory } from "./factories/contracts/core/collectors/RWAIndexTokenCollector__factory";
164
166
  export type { Treasury } from "./contracts/core/collectors/Treasury";
@@ -587,6 +589,8 @@ export type { MockToken } from "./contracts/mocks/core/tokens/MockToken";
587
589
  export { MockToken__factory } from "./factories/contracts/mocks/core/tokens/MockToken__factory";
588
590
  export type { MockUSDC } from "./contracts/mocks/core/tokens/MockUSDC";
589
591
  export { MockUSDC__factory } from "./factories/contracts/mocks/core/tokens/MockUSDC__factory";
592
+ export type { USDCTokenLimited } from "./contracts/mocks/core/tokens/USDCTokenLimited";
593
+ export { USDCTokenLimited__factory } from "./factories/contracts/mocks/core/tokens/USDCTokenLimited__factory";
590
594
  export type { RAACMockERC20 } from "./contracts/mocks/core/tokens/RAACMockERC20";
591
595
  export { RAACMockERC20__factory } from "./factories/contracts/mocks/core/tokens/RAACMockERC20__factory";
592
596
  export type { MockVault } from "./contracts/mocks/core/vaults/MockVault";
@@ -0,0 +1,23 @@
1
+ import { TokenAmount } from "../utils/amount";
2
+ /**
3
+ * USD price of one whole token, keyed by lowercase symbol, e.g. `{ raac: 5, pmusd: 1, ireet: 0.995 }`. The app
4
+ * builds it with its `usePrices` hook, so the rpc and the UI value everything identically.
5
+ */
6
+ export type UsdPrices = Record<string, number>;
7
+ /** A read that settled independently of the others: its data, or why it failed. One failure never blanks the rest. */
8
+ export type Section<T> = {
9
+ data: T;
10
+ error: null;
11
+ } | {
12
+ data: null;
13
+ error: Error;
14
+ };
15
+ /** Settles one read into a {@link Section}: never rejects, so reads awaited together fail independently. */
16
+ export declare const settled: <T>(read: Promise<T>) => Promise<Section<T>>;
17
+ /**
18
+ * USD value of an amount from `prices`, by the symbol `toTokenAmount` gave it from the chain config's token registry.
19
+ * Throws when there is no price, so the section fails visibly instead of reading 0.
20
+ *
21
+ * @param token - The amount's asset key or token address, named in the error.
22
+ */
23
+ export declare function requireUsd(prices: UsdPrices, amount: TokenAmount, token: string): number;
@@ -0,0 +1,67 @@
1
+ /** Whether a leg earns income or costs it. */
2
+ export type ReturnLegKind = "earning" | "cost";
3
+ /** What a leg earns or costs. A unit of capital earns each yield type at most once. */
4
+ export type ReturnLegYieldType = "supply" | "gauge" | "borrow";
5
+ /**
6
+ * One income stream in the user's position, as {@link computeEffectiveReturn} consumes it. Adding a venue (a new
7
+ * gauge, another pmUSD venue) only means adding a leg; the calculator does not change.
8
+ */
9
+ export interface ReturnLeg {
10
+ /** Stable key, e.g. "borrow", "supply", "gauge:r-rpmdepmUSD". */
11
+ id: string;
12
+ /** Display name, e.g. "Borrow pmUSD". */
13
+ source: string;
14
+ kind: ReturnLegKind;
15
+ yieldType: ReturnLegYieldType;
16
+ /**
17
+ * True when the leg's value is money the user holds and counts towards net capital (supplied). False for the
18
+ * debt itself, and for overlays such as a gauge, whose staked value is already counted in another leg.
19
+ */
20
+ countsAsCapital: boolean;
21
+ /** USD value the rate applies to. Never negative. */
22
+ valueUsd: number;
23
+ /** The projected one-year rate as a fraction, e.g. 0.0077 for 0.77%. */
24
+ rate: number;
25
+ /** How `rate` is quoted: "apy" when it already compounds (borrow), "apr" when it does not (supply, gauge). */
26
+ rateKind: "apr" | "apy";
27
+ }
28
+ export interface ReturnLegWithIncome extends ReturnLeg {
29
+ /** Projected income over one year in USD: `valueUsd * rate`, negative for a cost leg. */
30
+ income1y: number;
31
+ }
32
+ export interface EffectiveReturnInput {
33
+ legs: readonly ReturnLeg[];
34
+ /** USD value of the collateral backing the debt. */
35
+ collateralUsd: number;
36
+ /**
37
+ * USD value of capital that earns nothing, e.g. idle pmUSD in the wallet or a non-yielding coin inside a staked
38
+ * LP. It is not a leg (no income, not listed in a breakdown); it only adds to net capital.
39
+ */
40
+ idleUsd?: number;
41
+ }
42
+ export interface EffectiveReturn {
43
+ /** Earning legs' income minus cost legs' cost over one year, in USD. */
44
+ netIncome1y: number;
45
+ /** `netIncome1y / debtUsd` as a fraction; null when there is no debt. */
46
+ onDebt: number | null;
47
+ /** `netIncome1y / netCapitalUsd` as a fraction; null when net capital is zero or negative. */
48
+ onNetCapital: number | null;
49
+ /** Sum of the cost legs' values. */
50
+ debtUsd: number;
51
+ /** Collateral + capital legs + idle - debt. */
52
+ netCapitalUsd: number;
53
+ legs: ReturnLegWithIncome[];
54
+ }
55
+ /**
56
+ * Projects the user's net return over one year from a list of legs. Pure: no reads.
57
+ *
58
+ * netIncome1y = sum(earning valueUsd * rate) - sum(cost valueUsd * rate)
59
+ * onDebt = netIncome1y / total debt
60
+ * onNetCapital = netIncome1y / (collateral + capital legs + idle - total debt)
61
+ *
62
+ * The legs do not reinvest into each other, so this is a projected net return, not an APY.
63
+ *
64
+ * @param input - The legs, the collateral value and any idle capital, all in USD.
65
+ * @returns The net income, both returns and each leg with its own projected income.
66
+ */
67
+ export declare function computeEffectiveReturn({ legs, collateralUsd, idleUsd }: EffectiveReturnInput): EffectiveReturn;
@@ -0,0 +1,55 @@
1
+ import { Provider } from "ethers";
2
+ import { ChainId } from "../configs/chains";
3
+ import { GaugeSystemId } from "../configs/chains/chain";
4
+ import { TokenAmount } from "../utils/amount";
5
+ export interface ClaimableToken {
6
+ /** Token address. */
7
+ token: string;
8
+ amount: TokenAmount;
9
+ }
10
+ export interface ClaimableSource {
11
+ /** False when the source is not deployed on this chain. Nothing to show. */
12
+ available: boolean;
13
+ /** Tokens with a non-zero claimable amount. */
14
+ tokens: ClaimableToken[];
15
+ /** Why the source could not be read. The UI shows it on this row, never a silent zero. */
16
+ error: Error | null;
17
+ }
18
+ export interface GaugeClaimable extends ClaimableSource {
19
+ gauge: string;
20
+ id: string;
21
+ name: string;
22
+ system: GaugeSystemId;
23
+ }
24
+ export interface GaugeClaimables extends ClaimableSource {
25
+ /** One entry per configured gauge, including those with nothing to claim or a failed read. */
26
+ items: GaugeClaimable[];
27
+ /** Number of gauges with something to claim. */
28
+ claimableCount: number;
29
+ }
30
+ export interface UserClaimables {
31
+ chainId: ChainId;
32
+ user: string;
33
+ /** Main and extra rewards on every configured gauge of both systems. Claimed gauge RAAC goes to the liquid locker. */
34
+ gauges: GaugeClaimables;
35
+ /** veRAAC fee distributions, one token per reward token. */
36
+ veRAAC: ClaimableSource;
37
+ /** Realised RAAC in the maturity vault. */
38
+ maturityVault: ClaimableSource;
39
+ /** Bot locker rewards, every reward token. */
40
+ botLocker: ClaimableSource;
41
+ }
42
+ /**
43
+ * Everything a user can claim right now, across gauges, veRAAC fees, the maturity vault and the bot locker. Amounts
44
+ * only: the caller values them in USD with its own prices. Each source (and each gauge) is read independently, so one
45
+ * failing read shows as an error on that source and every other source still returns.
46
+ *
47
+ * Every configured gauge is scanned, not only those the user is staked in: a user can still have rewards after fully
48
+ * unstaking.
49
+ *
50
+ * @param chainId - The chain/network to use.
51
+ * @param user - The user's address.
52
+ * @param provider - Optional ethers.js Provider instance.
53
+ * @returns Per source: the non-zero claimable tokens, and an `error` when it failed.
54
+ */
55
+ export declare const getUserClaimables: (chainId: ChainId, user: string, provider?: Provider) => Promise<UserClaimables>;
@@ -0,0 +1,12 @@
1
+ import { Provider } from "ethers";
2
+ import { ChainId } from "../configs/chains";
3
+ import { TokenAmount } from "../utils/amount";
4
+ /**
5
+ * The iREET a user has deposited as collateral in the lending pool's iREET adapter. NFT collateral is not included.
6
+ *
7
+ * @param chainId - The chain/network to use.
8
+ * @param user - The user's address.
9
+ * @param provider - Optional ethers.js Provider instance.
10
+ * @returns The deposited iREET, with its registry decimals and symbol.
11
+ */
12
+ export declare const getUserCollateral: (chainId: ChainId, user: string, provider?: Provider) => Promise<TokenAmount>;
@@ -0,0 +1,18 @@
1
+ import { Provider } from "ethers";
2
+ import { ChainId } from "../configs/chains";
3
+ import { ScaledValue, TokenAmount } from "../utils/amount";
4
+ export interface UserDebt {
5
+ /** Current debt including accrued interest, in reserve units (pmUSD). */
6
+ amount: TokenAmount;
7
+ /** WAD health factor (liquidatable below 1e18); null when there is no debt. */
8
+ healthFactor: ScaledValue | null;
9
+ }
10
+ /**
11
+ * The debt and health factor of a user's iREET position in the lending pool.
12
+ *
13
+ * @param chainId - The chain/network to use.
14
+ * @param user - The user's address.
15
+ * @param provider - Optional ethers.js Provider instance.
16
+ * @returns The debt, and the health factor when there is debt.
17
+ */
18
+ export declare const getUserDebt: (chainId: ChainId, user: string, provider?: Provider) => Promise<UserDebt>;