Skip to content

Commit f083162

Browse files
mento-valclaude
andauthored
fix(borrow): correct JSDoc examples to use GBPm instead of USDm (MEN-41) (#138)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0c436e0 commit f083162

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

src/services/borrow/BorrowService.ts

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ import { DeploymentContext } from './internal/borrowTypes'
1919
* handle interest rates and batch managers, and query position data.
2020
*
2121
* All `build*` methods return `CallParams` ({ to, data, value }) that can be
22-
* executed with any wallet client. The `debtTokenSymbol` parameter (e.g., 'USDm')
22+
* executed with any wallet client. The `debtTokenSymbol` parameter (e.g., 'GBPm')
2323
* identifies which borrowing deployment to interact with.
2424
*
2525
* @example
2626
* ```typescript
2727
* const mento = await Mento.create(ChainId.CELO)
2828
*
2929
* // Open a trove
30-
* const tx = await mento.borrow.buildOpenTroveTransaction('USDm', {
30+
* const tx = await mento.borrow.buildOpenTroveTransaction('GBPm', {
3131
* owner: '0x...', ownerIndex: 0,
3232
* collAmount: parseUnits('10', 18),
3333
* boldAmount: parseUnits('1000', 18),
@@ -57,7 +57,7 @@ export class BorrowService {
5757
* Builds a transaction to open a new trove (borrowing position).
5858
* Requires prior collateral approval via `buildCollateralApprovalParams`.
5959
*
60-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
60+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
6161
* @param params - Trove opening parameters including collateral, debt amount, and interest rate
6262
* @returns Transaction parameters ready to send
6363
*/
@@ -68,7 +68,7 @@ export class BorrowService {
6868
/**
6969
* Builds a transaction to adjust an existing trove's collateral and/or debt.
7070
*
71-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
71+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
7272
* @param params - Adjustment parameters specifying collateral/debt changes
7373
* @returns Transaction parameters ready to send
7474
*/
@@ -80,7 +80,7 @@ export class BorrowService {
8080
* Builds a transaction to adjust a zombie trove (a trove that fell below minimum debt
8181
* after a liquidation). Same parameters as `buildAdjustTroveTransaction`.
8282
*
83-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
83+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
8484
* @param params - Adjustment parameters specifying collateral/debt changes
8585
* @returns Transaction parameters ready to send
8686
*/
@@ -96,7 +96,7 @@ export class BorrowService {
9696
/**
9797
* Builds a transaction to close a trove, repaying all debt and reclaiming collateral.
9898
*
99-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
99+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
100100
* @param troveId - The NFT token ID identifying the trove
101101
* @returns Transaction parameters ready to send
102102
*/
@@ -108,7 +108,7 @@ export class BorrowService {
108108
* Builds a transaction to add collateral to an existing trove.
109109
* Requires prior collateral approval via `buildCollateralApprovalParams`.
110110
*
111-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
111+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
112112
* @param troveId - The NFT token ID identifying the trove
113113
* @param amount - Amount of collateral to add (in wei)
114114
* @returns Transaction parameters ready to send
@@ -126,7 +126,7 @@ export class BorrowService {
126126
/**
127127
* Builds a transaction to withdraw collateral from an existing trove.
128128
*
129-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
129+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
130130
* @param troveId - The NFT token ID identifying the trove
131131
* @param amount - Amount of collateral to withdraw (in wei)
132132
* @returns Transaction parameters ready to send
@@ -144,7 +144,7 @@ export class BorrowService {
144144
/**
145145
* Builds a transaction to borrow additional debt against an existing trove.
146146
*
147-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
147+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
148148
* @param troveId - The NFT token ID identifying the trove
149149
* @param amount - Additional debt amount to borrow (in wei)
150150
* @param maxFee - Maximum upfront fee the borrower is willing to pay (in wei)
@@ -164,7 +164,7 @@ export class BorrowService {
164164
/**
165165
* Builds a transaction to repay debt on an existing trove.
166166
*
167-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
167+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
168168
* @param troveId - The NFT token ID identifying the trove
169169
* @param amount - Amount of debt to repay (in wei)
170170
* @returns Transaction parameters ready to send
@@ -182,7 +182,7 @@ export class BorrowService {
182182
/**
183183
* Builds a transaction to change the annual interest rate on a trove.
184184
*
185-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
185+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
186186
* @param troveId - The NFT token ID identifying the trove
187187
* @param newRate - New annual interest rate (18-decimal fixed-point, e.g., parseUnits('0.05', 18) for 5%)
188188
* @param maxFee - Maximum upfront fee the borrower is willing to pay (in wei)
@@ -202,7 +202,7 @@ export class BorrowService {
202202
/**
203203
* Builds a transaction to claim collateral surplus after a liquidation.
204204
*
205-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
205+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
206206
* @returns Transaction parameters ready to send
207207
*/
208208
buildClaimCollateralTransaction(debtTokenSymbol: string): Promise<CallParams> {
@@ -212,7 +212,7 @@ export class BorrowService {
212212
/**
213213
* Builds a transaction to delegate interest rate management to a batch manager.
214214
*
215-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
215+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
216216
* @param troveId - The NFT token ID identifying the trove
217217
* @param manager - Address of the batch manager contract
218218
* @param maxFee - Maximum upfront fee the borrower is willing to pay (in wei)
@@ -232,7 +232,7 @@ export class BorrowService {
232232
/**
233233
* Builds a transaction to remove a trove from a batch manager, setting a new individual rate.
234234
*
235-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
235+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
236236
* @param troveId - The NFT token ID identifying the trove
237237
* @param newRate - New individual annual interest rate (18-decimal fixed-point)
238238
* @param maxFee - Maximum upfront fee the borrower is willing to pay (in wei)
@@ -252,7 +252,7 @@ export class BorrowService {
252252
/**
253253
* Builds a transaction to switch a trove to a different batch manager.
254254
*
255-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
255+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
256256
* @param troveId - The NFT token ID identifying the trove
257257
* @param newManager - Address of the new batch manager contract
258258
* @param maxFee - Maximum upfront fee the borrower is willing to pay (in wei)
@@ -273,7 +273,7 @@ export class BorrowService {
273273
* Builds a transaction to delegate interest rate management to another address
274274
* with bounded rate constraints.
275275
*
276-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
276+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
277277
* @param troveId - The NFT token ID identifying the trove
278278
* @param delegate - Address to delegate interest rate management to
279279
* @param minRate - Minimum allowed annual interest rate (18-decimal fixed-point)
@@ -310,7 +310,7 @@ export class BorrowService {
310310
/**
311311
* Builds a transaction to remove the interest rate delegate from a trove.
312312
*
313-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
313+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
314314
* @param troveId - The NFT token ID identifying the trove
315315
* @returns Transaction parameters ready to send
316316
*/
@@ -327,7 +327,7 @@ export class BorrowService {
327327
* Builds approval params to allow BorrowerOperations to spend collateral tokens.
328328
* Must be executed before `buildOpenTroveTransaction` or `buildAddCollTransaction`.
329329
*
330-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
330+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
331331
* @param amount - Amount of collateral to approve (in wei)
332332
* @returns Transaction parameters for the ERC-20 approve call
333333
*/
@@ -340,7 +340,7 @@ export class BorrowService {
340340
/**
341341
* Builds approval params for the debt token (e.g., for repayment or closing).
342342
*
343-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
343+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
344344
* @param spender - Address to approve as spender
345345
* @param amount - Amount of debt tokens to approve (in wei)
346346
* @returns Transaction parameters for the ERC-20 approve call
@@ -358,7 +358,7 @@ export class BorrowService {
358358
/**
359359
* Builds approval params for the gas compensation token (required when opening a trove).
360360
*
361-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
361+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
362362
* @param amount - Amount to approve (in wei). If omitted, approves the gas compensation amount.
363363
* @returns Transaction parameters for the ERC-20 approve call
364364
*/
@@ -374,7 +374,7 @@ export class BorrowService {
374374
/**
375375
* Gets the current collateral token allowance for BorrowerOperations.
376376
*
377-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
377+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
378378
* @param owner - Address to check allowance for
379379
* @returns Current allowance in wei
380380
*/
@@ -385,7 +385,7 @@ export class BorrowService {
385385
/**
386386
* Gets the current debt token allowance for a specific spender.
387387
*
388-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
388+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
389389
* @param owner - Address to check allowance for
390390
* @param spender - Address of the approved spender
391391
* @returns Current allowance in wei
@@ -399,7 +399,7 @@ export class BorrowService {
399399
/**
400400
* Gets the current gas compensation token allowance.
401401
*
402-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
402+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
403403
* @param owner - Address to check allowance for
404404
* @returns Current allowance in wei
405405
*/
@@ -410,7 +410,7 @@ export class BorrowService {
410410
/**
411411
* Fetches on-chain data for a specific trove.
412412
*
413-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
413+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
414414
* @param troveId - The NFT token ID identifying the trove
415415
* @returns Trove position data including collateral, debt, interest rate, and status
416416
*/
@@ -421,7 +421,7 @@ export class BorrowService {
421421
/**
422422
* Fetches all troves owned by an address.
423423
*
424-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
424+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
425425
* @param owner - Address to query troves for
426426
* @returns Array of trove positions owned by the address
427427
*/
@@ -432,7 +432,7 @@ export class BorrowService {
432432
/**
433433
* Gets the current collateral token price from the price feed.
434434
*
435-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
435+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
436436
* @returns Collateral price in 18-decimal fixed-point format
437437
*/
438438
getCollateralPrice(debtTokenSymbol: string): Promise<bigint> {
@@ -443,7 +443,7 @@ export class BorrowService {
443443
* Gets the system parameters for a borrowing deployment.
444444
* Returns MCR, CCR, SCR, BCR, minimum debt, gas compensation, and minimum interest rate.
445445
*
446-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
446+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
447447
* @returns System parameters (all values in 18-decimal fixed-point)
448448
*/
449449
getSystemParams(debtTokenSymbol: string): Promise<SystemParams> {
@@ -453,7 +453,7 @@ export class BorrowService {
453453
/**
454454
* Checks whether the borrowing system has been shut down (e.g., during a crisis).
455455
*
456-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
456+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
457457
* @returns true if the system is shut down, false otherwise
458458
*/
459459
isSystemShutDown(debtTokenSymbol: string): Promise<boolean> {
@@ -463,7 +463,7 @@ export class BorrowService {
463463
/**
464464
* Gets aggregate collateral and debt statistics for the borrowing branch.
465465
*
466-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
466+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
467467
* @returns Total collateral and total debt across all troves (in wei)
468468
*/
469469
getBranchStats(debtTokenSymbol: string): Promise<{ totalColl: bigint; totalDebt: bigint }> {
@@ -473,7 +473,7 @@ export class BorrowService {
473473
/**
474474
* Gets the distribution of debt across interest rate brackets.
475475
*
476-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
476+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
477477
* @returns Array of brackets, each with a rate and total debt at that rate
478478
*/
479479
getInterestRateBrackets(debtTokenSymbol: string): Promise<InterestRateBracket[]> {
@@ -483,7 +483,7 @@ export class BorrowService {
483483
/**
484484
* Gets the weighted average interest rate across all active troves.
485485
*
486-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
486+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
487487
* @returns Average annual interest rate in 18-decimal fixed-point
488488
*/
489489
getAverageInterestRate(debtTokenSymbol: string): Promise<bigint> {
@@ -493,7 +493,7 @@ export class BorrowService {
493493
/**
494494
* Gets information about a batch manager's configuration.
495495
*
496-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
496+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
497497
* @param address - Address of the batch manager
498498
* @returns Batch manager config (min/max rate, min change period), or null if not a valid manager
499499
*/
@@ -507,7 +507,7 @@ export class BorrowService {
507507
/**
508508
* Estimates the upfront fee for opening a new trove.
509509
*
510-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
510+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
511511
* @param amount - Debt amount to borrow (in wei)
512512
* @param rate - Annual interest rate (18-decimal fixed-point)
513513
* @returns Estimated upfront fee in wei
@@ -525,7 +525,7 @@ export class BorrowService {
525525
/**
526526
* Estimates the upfront fee for increasing debt on an existing trove.
527527
*
528-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
528+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
529529
* @param troveId - The NFT token ID identifying the trove
530530
* @param debtIncrease - Amount of additional debt (in wei)
531531
* @returns Estimated upfront fee in wei
@@ -543,7 +543,7 @@ export class BorrowService {
543543
/**
544544
* Estimates the upfront fee for changing a trove's interest rate.
545545
*
546-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
546+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
547547
* @param troveId - The NFT token ID identifying the trove
548548
* @param newRate - New annual interest rate (18-decimal fixed-point)
549549
* @returns Estimated upfront fee in wei
@@ -561,7 +561,7 @@ export class BorrowService {
561561
/**
562562
* Estimates the upfront fee for joining a batch manager.
563563
*
564-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
564+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
565565
* @param troveId - The NFT token ID identifying the trove
566566
* @param batchAddress - Address of the batch manager to join
567567
* @returns Estimated upfront fee in wei
@@ -580,7 +580,7 @@ export class BorrowService {
580580
* Gets the next available owner index for opening a new trove.
581581
* Each owner can have multiple troves, indexed starting from 0.
582582
*
583-
* @param debtTokenSymbol - The debt token symbol (e.g., 'USDm')
583+
* @param debtTokenSymbol - The debt token symbol (e.g., 'GBPm')
584584
* @param owner - Address of the trove owner
585585
* @returns The next available index (pass to OpenTroveParams.ownerIndex)
586586
*/

0 commit comments

Comments
 (0)