carbon-js-sdk 0.6.2 → 0.6.3

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 (106) hide show
  1. package/lib/CarbonSDK.d.ts +1 -0
  2. package/lib/CarbonSDK.js +8 -6
  3. package/lib/clients/BatchQueryClient.js +4 -4
  4. package/lib/clients/CarbonQueryClient.js +1 -1
  5. package/lib/clients/ETHClient.d.ts +1 -0
  6. package/lib/clients/ETHClient.js +17 -17
  7. package/lib/clients/HydrogenClient.js +1 -1
  8. package/lib/clients/InsightsQueryClient.js +3 -3
  9. package/lib/clients/NEOClient.js +7 -7
  10. package/lib/clients/TokenClient.js +2 -2
  11. package/lib/clients/ZILClient.js +17 -17
  12. package/lib/codec/book/book.d.ts +14 -2
  13. package/lib/codec/book/book.js +80 -13
  14. package/lib/codec/book/legacy.d.ts +22 -0
  15. package/lib/codec/book/legacy.js +120 -0
  16. package/lib/codec/book/query.d.ts +48 -1
  17. package/lib/codec/book/query.js +224 -1
  18. package/lib/codec/cdp/event.d.ts +12 -6
  19. package/lib/codec/cdp/event.js +146 -68
  20. package/lib/codec/cdp/params.d.ts +0 -2
  21. package/lib/codec/cdp/params.js +8 -23
  22. package/lib/codec/cdp/query.d.ts +22 -1
  23. package/lib/codec/cdp/query.js +104 -17
  24. package/lib/codec/cosmos/gov/v1/query.js +2 -2
  25. package/lib/codec/cosmos/gov/v1/tx.js +2 -2
  26. package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
  27. package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
  28. package/lib/codec/cosmos/group/v1/events.js +2 -2
  29. package/lib/codec/cosmos/group/v1/tx.js +4 -4
  30. package/lib/codec/cosmos/tx/v1beta1/tx.js +4 -4
  31. package/lib/codec/index.d.ts +11 -9
  32. package/lib/codec/index.js +405 -133
  33. package/lib/codec/liquiditypool/event.d.ts +25 -1
  34. package/lib/codec/liquiditypool/event.js +147 -1
  35. package/lib/codec/liquiditypool/genesis.d.ts +4 -5
  36. package/lib/codec/liquiditypool/genesis.js +34 -49
  37. package/lib/codec/liquiditypool/query.d.ts +2 -51
  38. package/lib/codec/liquiditypool/query.js +18 -265
  39. package/lib/codec/liquiditypool/reward.d.ts +21 -21
  40. package/lib/codec/liquiditypool/reward.js +97 -111
  41. package/lib/codec/oracle/query.d.ts +37 -34
  42. package/lib/codec/oracle/query.js +37 -31
  43. package/lib/codec/position/position.d.ts +2 -0
  44. package/lib/codec/position/position.js +34 -0
  45. package/lib/codec/subaccount/genesis.d.ts +5 -1
  46. package/lib/codec/subaccount/genesis.js +48 -2
  47. package/lib/codec/subaccount/query.d.ts +110 -21
  48. package/lib/codec/subaccount/query.js +503 -47
  49. package/lib/codec/subaccount/subaccount.d.ts +29 -3
  50. package/lib/codec/subaccount/subaccount.js +234 -31
  51. package/lib/codec/subaccount/tx.d.ts +7 -1
  52. package/lib/codec/subaccount/tx.js +101 -16
  53. package/lib/constant/generic.js +1 -1
  54. package/lib/modules/cdp.js +45 -45
  55. package/lib/modules/cosmwasm.js +2 -2
  56. package/lib/modules/evm.js +5 -5
  57. package/lib/modules/gov.js +12 -12
  58. package/lib/modules/liquiditypool.js +1 -1
  59. package/lib/modules/order.js +2 -2
  60. package/lib/modules/subaccount.js +1 -1
  61. package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
  62. package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +1 -1
  63. package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.js +8 -8
  64. package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.js +3 -3
  65. package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +1 -1
  66. package/lib/provider/amino/types/admin.js +27 -27
  67. package/lib/provider/amino/types/bank.js +1 -1
  68. package/lib/provider/amino/types/broker.js +1 -1
  69. package/lib/provider/amino/types/cdp.js +25 -25
  70. package/lib/provider/amino/types/coin.js +4 -4
  71. package/lib/provider/amino/types/evm.js +2 -2
  72. package/lib/provider/amino/types/evmmerge.js +1 -1
  73. package/lib/provider/amino/types/feemarket.js +1 -1
  74. package/lib/provider/amino/types/gov.js +5 -5
  75. package/lib/provider/amino/types/ibc.js +1 -1
  76. package/lib/provider/amino/types/leverage.js +1 -1
  77. package/lib/provider/amino/types/liquidityPool.js +7 -7
  78. package/lib/provider/amino/types/market.js +6 -6
  79. package/lib/provider/amino/types/oracle.js +2 -2
  80. package/lib/provider/amino/types/order.js +4 -4
  81. package/lib/provider/amino/types/position.js +1 -1
  82. package/lib/provider/amino/types/profile.js +1 -1
  83. package/lib/provider/amino/types/staking.js +4 -4
  84. package/lib/provider/amino/types/subaccount.js +3 -3
  85. package/lib/provider/amino/utils.js +11 -11
  86. package/lib/provider/keplr/KeplrAccount.js +2 -2
  87. package/lib/provider/ledger/ledger.js +2 -2
  88. package/lib/provider/metamask/MetaMask.js +13 -13
  89. package/lib/provider/o3/O3Wallet.js +2 -2
  90. package/lib/util/address.js +14 -14
  91. package/lib/util/api.js +4 -4
  92. package/lib/util/blockchain.d.ts +1 -1
  93. package/lib/util/blockchain.js +4 -4
  94. package/lib/util/eip712.js +3 -3
  95. package/lib/util/fetch.js +1 -1
  96. package/lib/util/generic.js +3 -3
  97. package/lib/util/legacyEIP712.js +2 -2
  98. package/lib/util/network.js +3 -3
  99. package/lib/util/number.js +5 -5
  100. package/lib/wallet/CarbonSigner.js +2 -2
  101. package/lib/wallet/CarbonSigningClient.js +15 -15
  102. package/lib/wallet/CarbonWallet.js +9 -9
  103. package/lib/websocket/connector.js +3 -3
  104. package/package.json +1 -1
  105. package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.d.ts +0 -76
  106. package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.js +0 -424
@@ -1290,7 +1290,8 @@ const baseBorrowAssetEvent = {
1290
1290
  borrower: "",
1291
1291
  denom: "",
1292
1292
  amountBorrowed: "",
1293
- healthFactor: "",
1293
+ debtValue: "",
1294
+ collateralValue: "",
1294
1295
  initialCumulativeInterestMultiplier: "",
1295
1296
  };
1296
1297
  exports.BorrowAssetEvent = {
@@ -1304,8 +1305,11 @@ exports.BorrowAssetEvent = {
1304
1305
  if (message.amountBorrowed !== "") {
1305
1306
  writer.uint32(26).string(message.amountBorrowed);
1306
1307
  }
1307
- if (message.healthFactor !== "") {
1308
- writer.uint32(34).string(message.healthFactor);
1308
+ if (message.debtValue !== "") {
1309
+ writer.uint32(34).string(message.debtValue);
1310
+ }
1311
+ if (message.collateralValue !== "") {
1312
+ writer.uint32(50).string(message.collateralValue);
1309
1313
  }
1310
1314
  if (message.initialCumulativeInterestMultiplier !== "") {
1311
1315
  writer.uint32(42).string(message.initialCumulativeInterestMultiplier);
@@ -1329,7 +1333,10 @@ exports.BorrowAssetEvent = {
1329
1333
  message.amountBorrowed = reader.string();
1330
1334
  break;
1331
1335
  case 4:
1332
- message.healthFactor = reader.string();
1336
+ message.debtValue = reader.string();
1337
+ break;
1338
+ case 6:
1339
+ message.collateralValue = reader.string();
1333
1340
  break;
1334
1341
  case 5:
1335
1342
  message.initialCumulativeInterestMultiplier = reader.string();
@@ -1355,9 +1362,13 @@ exports.BorrowAssetEvent = {
1355
1362
  object.amountBorrowed !== undefined && object.amountBorrowed !== null
1356
1363
  ? String(object.amountBorrowed)
1357
1364
  : "";
1358
- message.healthFactor =
1359
- object.healthFactor !== undefined && object.healthFactor !== null
1360
- ? String(object.healthFactor)
1365
+ message.debtValue =
1366
+ object.debtValue !== undefined && object.debtValue !== null
1367
+ ? String(object.debtValue)
1368
+ : "";
1369
+ message.collateralValue =
1370
+ object.collateralValue !== undefined && object.collateralValue !== null
1371
+ ? String(object.collateralValue)
1361
1372
  : "";
1362
1373
  message.initialCumulativeInterestMultiplier =
1363
1374
  object.initialCumulativeInterestMultiplier !== undefined &&
@@ -1372,22 +1383,24 @@ exports.BorrowAssetEvent = {
1372
1383
  message.denom !== undefined && (obj.denom = message.denom);
1373
1384
  message.amountBorrowed !== undefined &&
1374
1385
  (obj.amountBorrowed = message.amountBorrowed);
1375
- message.healthFactor !== undefined &&
1376
- (obj.healthFactor = message.healthFactor);
1386
+ message.debtValue !== undefined && (obj.debtValue = message.debtValue);
1387
+ message.collateralValue !== undefined &&
1388
+ (obj.collateralValue = message.collateralValue);
1377
1389
  message.initialCumulativeInterestMultiplier !== undefined &&
1378
1390
  (obj.initialCumulativeInterestMultiplier =
1379
1391
  message.initialCumulativeInterestMultiplier);
1380
1392
  return obj;
1381
1393
  },
1382
1394
  fromPartial(object) {
1383
- var _a, _b, _c, _d, _e;
1395
+ var _a, _b, _c, _d, _e, _f;
1384
1396
  const message = Object.assign({}, baseBorrowAssetEvent);
1385
1397
  message.borrower = (_a = object.borrower) !== null && _a !== void 0 ? _a : "";
1386
1398
  message.denom = (_b = object.denom) !== null && _b !== void 0 ? _b : "";
1387
1399
  message.amountBorrowed = (_c = object.amountBorrowed) !== null && _c !== void 0 ? _c : "";
1388
- message.healthFactor = (_d = object.healthFactor) !== null && _d !== void 0 ? _d : "";
1400
+ message.debtValue = (_d = object.debtValue) !== null && _d !== void 0 ? _d : "";
1401
+ message.collateralValue = (_e = object.collateralValue) !== null && _e !== void 0 ? _e : "";
1389
1402
  message.initialCumulativeInterestMultiplier =
1390
- (_e = object.initialCumulativeInterestMultiplier) !== null && _e !== void 0 ? _e : "";
1403
+ (_f = object.initialCumulativeInterestMultiplier) !== null && _f !== void 0 ? _f : "";
1391
1404
  return message;
1392
1405
  },
1393
1406
  };
@@ -1397,7 +1410,8 @@ const baseRepayAssetEvent = {
1397
1410
  denom: "",
1398
1411
  principalRepaid: "",
1399
1412
  interestRepaid: "",
1400
- healthFactor: "",
1413
+ debtValue: "",
1414
+ collateralValue: "",
1401
1415
  };
1402
1416
  exports.RepayAssetEvent = {
1403
1417
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -1416,8 +1430,11 @@ exports.RepayAssetEvent = {
1416
1430
  if (message.interestRepaid !== "") {
1417
1431
  writer.uint32(42).string(message.interestRepaid);
1418
1432
  }
1419
- if (message.healthFactor !== "") {
1420
- writer.uint32(50).string(message.healthFactor);
1433
+ if (message.debtValue !== "") {
1434
+ writer.uint32(50).string(message.debtValue);
1435
+ }
1436
+ if (message.collateralValue !== "") {
1437
+ writer.uint32(58).string(message.collateralValue);
1421
1438
  }
1422
1439
  return writer;
1423
1440
  },
@@ -1444,7 +1461,10 @@ exports.RepayAssetEvent = {
1444
1461
  message.interestRepaid = reader.string();
1445
1462
  break;
1446
1463
  case 6:
1447
- message.healthFactor = reader.string();
1464
+ message.debtValue = reader.string();
1465
+ break;
1466
+ case 7:
1467
+ message.collateralValue = reader.string();
1448
1468
  break;
1449
1469
  default:
1450
1470
  reader.skipType(tag & 7);
@@ -1475,9 +1495,13 @@ exports.RepayAssetEvent = {
1475
1495
  object.interestRepaid !== undefined && object.interestRepaid !== null
1476
1496
  ? String(object.interestRepaid)
1477
1497
  : "";
1478
- message.healthFactor =
1479
- object.healthFactor !== undefined && object.healthFactor !== null
1480
- ? String(object.healthFactor)
1498
+ message.debtValue =
1499
+ object.debtValue !== undefined && object.debtValue !== null
1500
+ ? String(object.debtValue)
1501
+ : "";
1502
+ message.collateralValue =
1503
+ object.collateralValue !== undefined && object.collateralValue !== null
1504
+ ? String(object.collateralValue)
1481
1505
  : "";
1482
1506
  return message;
1483
1507
  },
@@ -1490,19 +1514,21 @@ exports.RepayAssetEvent = {
1490
1514
  (obj.principalRepaid = message.principalRepaid);
1491
1515
  message.interestRepaid !== undefined &&
1492
1516
  (obj.interestRepaid = message.interestRepaid);
1493
- message.healthFactor !== undefined &&
1494
- (obj.healthFactor = message.healthFactor);
1517
+ message.debtValue !== undefined && (obj.debtValue = message.debtValue);
1518
+ message.collateralValue !== undefined &&
1519
+ (obj.collateralValue = message.collateralValue);
1495
1520
  return obj;
1496
1521
  },
1497
1522
  fromPartial(object) {
1498
- var _a, _b, _c, _d, _e, _f;
1523
+ var _a, _b, _c, _d, _e, _f, _g;
1499
1524
  const message = Object.assign({}, baseRepayAssetEvent);
1500
1525
  message.repayer = (_a = object.repayer) !== null && _a !== void 0 ? _a : "";
1501
1526
  message.debtor = (_b = object.debtor) !== null && _b !== void 0 ? _b : "";
1502
1527
  message.denom = (_c = object.denom) !== null && _c !== void 0 ? _c : "";
1503
1528
  message.principalRepaid = (_d = object.principalRepaid) !== null && _d !== void 0 ? _d : "";
1504
1529
  message.interestRepaid = (_e = object.interestRepaid) !== null && _e !== void 0 ? _e : "";
1505
- message.healthFactor = (_f = object.healthFactor) !== null && _f !== void 0 ? _f : "";
1530
+ message.debtValue = (_f = object.debtValue) !== null && _f !== void 0 ? _f : "";
1531
+ message.collateralValue = (_g = object.collateralValue) !== null && _g !== void 0 ? _g : "";
1506
1532
  return message;
1507
1533
  },
1508
1534
  };
@@ -1510,7 +1536,8 @@ const baseLockCollateralEvent = {
1510
1536
  locker: "",
1511
1537
  cdpDenom: "",
1512
1538
  amountLocked: "",
1513
- healthFactor: "",
1539
+ debtValue: "",
1540
+ collateralValue: "",
1514
1541
  };
1515
1542
  exports.LockCollateralEvent = {
1516
1543
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -1523,8 +1550,11 @@ exports.LockCollateralEvent = {
1523
1550
  if (message.amountLocked !== "") {
1524
1551
  writer.uint32(26).string(message.amountLocked);
1525
1552
  }
1526
- if (message.healthFactor !== "") {
1527
- writer.uint32(34).string(message.healthFactor);
1553
+ if (message.debtValue !== "") {
1554
+ writer.uint32(34).string(message.debtValue);
1555
+ }
1556
+ if (message.collateralValue !== "") {
1557
+ writer.uint32(42).string(message.collateralValue);
1528
1558
  }
1529
1559
  return writer;
1530
1560
  },
@@ -1545,7 +1575,10 @@ exports.LockCollateralEvent = {
1545
1575
  message.amountLocked = reader.string();
1546
1576
  break;
1547
1577
  case 4:
1548
- message.healthFactor = reader.string();
1578
+ message.debtValue = reader.string();
1579
+ break;
1580
+ case 5:
1581
+ message.collateralValue = reader.string();
1549
1582
  break;
1550
1583
  default:
1551
1584
  reader.skipType(tag & 7);
@@ -1568,9 +1601,13 @@ exports.LockCollateralEvent = {
1568
1601
  object.amountLocked !== undefined && object.amountLocked !== null
1569
1602
  ? String(object.amountLocked)
1570
1603
  : "";
1571
- message.healthFactor =
1572
- object.healthFactor !== undefined && object.healthFactor !== null
1573
- ? String(object.healthFactor)
1604
+ message.debtValue =
1605
+ object.debtValue !== undefined && object.debtValue !== null
1606
+ ? String(object.debtValue)
1607
+ : "";
1608
+ message.collateralValue =
1609
+ object.collateralValue !== undefined && object.collateralValue !== null
1610
+ ? String(object.collateralValue)
1574
1611
  : "";
1575
1612
  return message;
1576
1613
  },
@@ -1580,17 +1617,19 @@ exports.LockCollateralEvent = {
1580
1617
  message.cdpDenom !== undefined && (obj.cdpDenom = message.cdpDenom);
1581
1618
  message.amountLocked !== undefined &&
1582
1619
  (obj.amountLocked = message.amountLocked);
1583
- message.healthFactor !== undefined &&
1584
- (obj.healthFactor = message.healthFactor);
1620
+ message.debtValue !== undefined && (obj.debtValue = message.debtValue);
1621
+ message.collateralValue !== undefined &&
1622
+ (obj.collateralValue = message.collateralValue);
1585
1623
  return obj;
1586
1624
  },
1587
1625
  fromPartial(object) {
1588
- var _a, _b, _c, _d;
1626
+ var _a, _b, _c, _d, _e;
1589
1627
  const message = Object.assign({}, baseLockCollateralEvent);
1590
1628
  message.locker = (_a = object.locker) !== null && _a !== void 0 ? _a : "";
1591
1629
  message.cdpDenom = (_b = object.cdpDenom) !== null && _b !== void 0 ? _b : "";
1592
1630
  message.amountLocked = (_c = object.amountLocked) !== null && _c !== void 0 ? _c : "";
1593
- message.healthFactor = (_d = object.healthFactor) !== null && _d !== void 0 ? _d : "";
1631
+ message.debtValue = (_d = object.debtValue) !== null && _d !== void 0 ? _d : "";
1632
+ message.collateralValue = (_e = object.collateralValue) !== null && _e !== void 0 ? _e : "";
1594
1633
  return message;
1595
1634
  },
1596
1635
  };
@@ -1598,7 +1637,8 @@ const baseUnlockCollateralEvent = {
1598
1637
  unlocker: "",
1599
1638
  cdpDenom: "",
1600
1639
  amountUnlocked: "",
1601
- healthFactor: "",
1640
+ debtValue: "",
1641
+ collateralValue: "",
1602
1642
  };
1603
1643
  exports.UnlockCollateralEvent = {
1604
1644
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -1611,8 +1651,11 @@ exports.UnlockCollateralEvent = {
1611
1651
  if (message.amountUnlocked !== "") {
1612
1652
  writer.uint32(26).string(message.amountUnlocked);
1613
1653
  }
1614
- if (message.healthFactor !== "") {
1615
- writer.uint32(34).string(message.healthFactor);
1654
+ if (message.debtValue !== "") {
1655
+ writer.uint32(34).string(message.debtValue);
1656
+ }
1657
+ if (message.collateralValue !== "") {
1658
+ writer.uint32(42).string(message.collateralValue);
1616
1659
  }
1617
1660
  return writer;
1618
1661
  },
@@ -1633,7 +1676,10 @@ exports.UnlockCollateralEvent = {
1633
1676
  message.amountUnlocked = reader.string();
1634
1677
  break;
1635
1678
  case 4:
1636
- message.healthFactor = reader.string();
1679
+ message.debtValue = reader.string();
1680
+ break;
1681
+ case 5:
1682
+ message.collateralValue = reader.string();
1637
1683
  break;
1638
1684
  default:
1639
1685
  reader.skipType(tag & 7);
@@ -1656,9 +1702,13 @@ exports.UnlockCollateralEvent = {
1656
1702
  object.amountUnlocked !== undefined && object.amountUnlocked !== null
1657
1703
  ? String(object.amountUnlocked)
1658
1704
  : "";
1659
- message.healthFactor =
1660
- object.healthFactor !== undefined && object.healthFactor !== null
1661
- ? String(object.healthFactor)
1705
+ message.debtValue =
1706
+ object.debtValue !== undefined && object.debtValue !== null
1707
+ ? String(object.debtValue)
1708
+ : "";
1709
+ message.collateralValue =
1710
+ object.collateralValue !== undefined && object.collateralValue !== null
1711
+ ? String(object.collateralValue)
1662
1712
  : "";
1663
1713
  return message;
1664
1714
  },
@@ -1668,17 +1718,19 @@ exports.UnlockCollateralEvent = {
1668
1718
  message.cdpDenom !== undefined && (obj.cdpDenom = message.cdpDenom);
1669
1719
  message.amountUnlocked !== undefined &&
1670
1720
  (obj.amountUnlocked = message.amountUnlocked);
1671
- message.healthFactor !== undefined &&
1672
- (obj.healthFactor = message.healthFactor);
1721
+ message.debtValue !== undefined && (obj.debtValue = message.debtValue);
1722
+ message.collateralValue !== undefined &&
1723
+ (obj.collateralValue = message.collateralValue);
1673
1724
  return obj;
1674
1725
  },
1675
1726
  fromPartial(object) {
1676
- var _a, _b, _c, _d;
1727
+ var _a, _b, _c, _d, _e;
1677
1728
  const message = Object.assign({}, baseUnlockCollateralEvent);
1678
1729
  message.unlocker = (_a = object.unlocker) !== null && _a !== void 0 ? _a : "";
1679
1730
  message.cdpDenom = (_b = object.cdpDenom) !== null && _b !== void 0 ? _b : "";
1680
1731
  message.amountUnlocked = (_c = object.amountUnlocked) !== null && _c !== void 0 ? _c : "";
1681
- message.healthFactor = (_d = object.healthFactor) !== null && _d !== void 0 ? _d : "";
1732
+ message.debtValue = (_d = object.debtValue) !== null && _d !== void 0 ? _d : "";
1733
+ message.collateralValue = (_e = object.collateralValue) !== null && _e !== void 0 ? _e : "";
1682
1734
  return message;
1683
1735
  },
1684
1736
  };
@@ -1814,7 +1866,8 @@ const baseMintStablecoinEvent = {
1814
1866
  minter: "",
1815
1867
  denom: "",
1816
1868
  amountMinted: "",
1817
- healthFactor: "",
1869
+ debtValue: "",
1870
+ collateralValue: "",
1818
1871
  initialCumulativeInterestMultiplier: "",
1819
1872
  };
1820
1873
  exports.MintStablecoinEvent = {
@@ -1828,8 +1881,11 @@ exports.MintStablecoinEvent = {
1828
1881
  if (message.amountMinted !== "") {
1829
1882
  writer.uint32(26).string(message.amountMinted);
1830
1883
  }
1831
- if (message.healthFactor !== "") {
1832
- writer.uint32(34).string(message.healthFactor);
1884
+ if (message.debtValue !== "") {
1885
+ writer.uint32(34).string(message.debtValue);
1886
+ }
1887
+ if (message.collateralValue !== "") {
1888
+ writer.uint32(50).string(message.collateralValue);
1833
1889
  }
1834
1890
  if (message.initialCumulativeInterestMultiplier !== "") {
1835
1891
  writer.uint32(42).string(message.initialCumulativeInterestMultiplier);
@@ -1853,7 +1909,10 @@ exports.MintStablecoinEvent = {
1853
1909
  message.amountMinted = reader.string();
1854
1910
  break;
1855
1911
  case 4:
1856
- message.healthFactor = reader.string();
1912
+ message.debtValue = reader.string();
1913
+ break;
1914
+ case 6:
1915
+ message.collateralValue = reader.string();
1857
1916
  break;
1858
1917
  case 5:
1859
1918
  message.initialCumulativeInterestMultiplier = reader.string();
@@ -1879,9 +1938,13 @@ exports.MintStablecoinEvent = {
1879
1938
  object.amountMinted !== undefined && object.amountMinted !== null
1880
1939
  ? String(object.amountMinted)
1881
1940
  : "";
1882
- message.healthFactor =
1883
- object.healthFactor !== undefined && object.healthFactor !== null
1884
- ? String(object.healthFactor)
1941
+ message.debtValue =
1942
+ object.debtValue !== undefined && object.debtValue !== null
1943
+ ? String(object.debtValue)
1944
+ : "";
1945
+ message.collateralValue =
1946
+ object.collateralValue !== undefined && object.collateralValue !== null
1947
+ ? String(object.collateralValue)
1885
1948
  : "";
1886
1949
  message.initialCumulativeInterestMultiplier =
1887
1950
  object.initialCumulativeInterestMultiplier !== undefined &&
@@ -1896,22 +1959,24 @@ exports.MintStablecoinEvent = {
1896
1959
  message.denom !== undefined && (obj.denom = message.denom);
1897
1960
  message.amountMinted !== undefined &&
1898
1961
  (obj.amountMinted = message.amountMinted);
1899
- message.healthFactor !== undefined &&
1900
- (obj.healthFactor = message.healthFactor);
1962
+ message.debtValue !== undefined && (obj.debtValue = message.debtValue);
1963
+ message.collateralValue !== undefined &&
1964
+ (obj.collateralValue = message.collateralValue);
1901
1965
  message.initialCumulativeInterestMultiplier !== undefined &&
1902
1966
  (obj.initialCumulativeInterestMultiplier =
1903
1967
  message.initialCumulativeInterestMultiplier);
1904
1968
  return obj;
1905
1969
  },
1906
1970
  fromPartial(object) {
1907
- var _a, _b, _c, _d, _e;
1971
+ var _a, _b, _c, _d, _e, _f;
1908
1972
  const message = Object.assign({}, baseMintStablecoinEvent);
1909
1973
  message.minter = (_a = object.minter) !== null && _a !== void 0 ? _a : "";
1910
1974
  message.denom = (_b = object.denom) !== null && _b !== void 0 ? _b : "";
1911
1975
  message.amountMinted = (_c = object.amountMinted) !== null && _c !== void 0 ? _c : "";
1912
- message.healthFactor = (_d = object.healthFactor) !== null && _d !== void 0 ? _d : "";
1976
+ message.debtValue = (_d = object.debtValue) !== null && _d !== void 0 ? _d : "";
1977
+ message.collateralValue = (_e = object.collateralValue) !== null && _e !== void 0 ? _e : "";
1913
1978
  message.initialCumulativeInterestMultiplier =
1914
- (_e = object.initialCumulativeInterestMultiplier) !== null && _e !== void 0 ? _e : "";
1979
+ (_f = object.initialCumulativeInterestMultiplier) !== null && _f !== void 0 ? _f : "";
1915
1980
  return message;
1916
1981
  },
1917
1982
  };
@@ -1921,7 +1986,8 @@ const baseReturnStablecoinEvent = {
1921
1986
  interestDenom: "",
1922
1987
  interestRepaid: "",
1923
1988
  principalRepaid: "",
1924
- healthFactor: "",
1989
+ debtValue: "",
1990
+ collateralValue: "",
1925
1991
  };
1926
1992
  exports.ReturnStablecoinEvent = {
1927
1993
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -1940,8 +2006,11 @@ exports.ReturnStablecoinEvent = {
1940
2006
  if (message.principalRepaid !== "") {
1941
2007
  writer.uint32(42).string(message.principalRepaid);
1942
2008
  }
1943
- if (message.healthFactor !== "") {
1944
- writer.uint32(50).string(message.healthFactor);
2009
+ if (message.debtValue !== "") {
2010
+ writer.uint32(50).string(message.debtValue);
2011
+ }
2012
+ if (message.collateralValue !== "") {
2013
+ writer.uint32(58).string(message.collateralValue);
1945
2014
  }
1946
2015
  return writer;
1947
2016
  },
@@ -1968,7 +2037,10 @@ exports.ReturnStablecoinEvent = {
1968
2037
  message.principalRepaid = reader.string();
1969
2038
  break;
1970
2039
  case 6:
1971
- message.healthFactor = reader.string();
2040
+ message.debtValue = reader.string();
2041
+ break;
2042
+ case 7:
2043
+ message.collateralValue = reader.string();
1972
2044
  break;
1973
2045
  default:
1974
2046
  reader.skipType(tag & 7);
@@ -1999,9 +2071,13 @@ exports.ReturnStablecoinEvent = {
1999
2071
  object.principalRepaid !== undefined && object.principalRepaid !== null
2000
2072
  ? String(object.principalRepaid)
2001
2073
  : "";
2002
- message.healthFactor =
2003
- object.healthFactor !== undefined && object.healthFactor !== null
2004
- ? String(object.healthFactor)
2074
+ message.debtValue =
2075
+ object.debtValue !== undefined && object.debtValue !== null
2076
+ ? String(object.debtValue)
2077
+ : "";
2078
+ message.collateralValue =
2079
+ object.collateralValue !== undefined && object.collateralValue !== null
2080
+ ? String(object.collateralValue)
2005
2081
  : "";
2006
2082
  return message;
2007
2083
  },
@@ -2015,19 +2091,21 @@ exports.ReturnStablecoinEvent = {
2015
2091
  (obj.interestRepaid = message.interestRepaid);
2016
2092
  message.principalRepaid !== undefined &&
2017
2093
  (obj.principalRepaid = message.principalRepaid);
2018
- message.healthFactor !== undefined &&
2019
- (obj.healthFactor = message.healthFactor);
2094
+ message.debtValue !== undefined && (obj.debtValue = message.debtValue);
2095
+ message.collateralValue !== undefined &&
2096
+ (obj.collateralValue = message.collateralValue);
2020
2097
  return obj;
2021
2098
  },
2022
2099
  fromPartial(object) {
2023
- var _a, _b, _c, _d, _e, _f;
2100
+ var _a, _b, _c, _d, _e, _f, _g;
2024
2101
  const message = Object.assign({}, baseReturnStablecoinEvent);
2025
2102
  message.returner = (_a = object.returner) !== null && _a !== void 0 ? _a : "";
2026
2103
  message.debtor = (_b = object.debtor) !== null && _b !== void 0 ? _b : "";
2027
2104
  message.interestDenom = (_c = object.interestDenom) !== null && _c !== void 0 ? _c : "";
2028
2105
  message.interestRepaid = (_d = object.interestRepaid) !== null && _d !== void 0 ? _d : "";
2029
2106
  message.principalRepaid = (_e = object.principalRepaid) !== null && _e !== void 0 ? _e : "";
2030
- message.healthFactor = (_f = object.healthFactor) !== null && _f !== void 0 ? _f : "";
2107
+ message.debtValue = (_f = object.debtValue) !== null && _f !== void 0 ? _f : "";
2108
+ message.collateralValue = (_g = object.collateralValue) !== null && _g !== void 0 ? _g : "";
2031
2109
  return message;
2032
2110
  },
2033
2111
  };
@@ -6,8 +6,6 @@ export declare const protobufPackage = "Switcheo.carbon.cdp";
6
6
  export interface Params {
7
7
  interestFee: string;
8
8
  liquidationFee: string;
9
- /** Stablecoin interest rate deprecated. Moved to stablecoin_interest_info.proto */
10
- stablecoinInterestRate: string;
11
9
  stablecoinMintCap: string;
12
10
  /**
13
11
  * Complete Liquidation Threshold determines how far between
@@ -12,7 +12,6 @@ exports.protobufPackage = "Switcheo.carbon.cdp";
12
12
  const baseParams = {
13
13
  interestFee: "",
14
14
  liquidationFee: "",
15
- stablecoinInterestRate: "",
16
15
  stablecoinMintCap: "",
17
16
  completeLiquidationThreshold: "",
18
17
  minimumCloseFactor: "",
@@ -29,9 +28,6 @@ exports.Params = {
29
28
  if (message.liquidationFee !== "") {
30
29
  writer.uint32(18).string(message.liquidationFee);
31
30
  }
32
- if (message.stablecoinInterestRate !== "") {
33
- writer.uint32(26).string(message.stablecoinInterestRate);
34
- }
35
31
  if (message.stablecoinMintCap !== "") {
36
32
  writer.uint32(34).string(message.stablecoinMintCap);
37
33
  }
@@ -73,9 +69,6 @@ exports.Params = {
73
69
  case 2:
74
70
  message.liquidationFee = reader.string();
75
71
  break;
76
- case 3:
77
- message.stablecoinInterestRate = reader.string();
78
- break;
79
72
  case 4:
80
73
  message.stablecoinMintCap = reader.string();
81
74
  break;
@@ -117,11 +110,6 @@ exports.Params = {
117
110
  object.liquidationFee !== undefined && object.liquidationFee !== null
118
111
  ? String(object.liquidationFee)
119
112
  : "";
120
- message.stablecoinInterestRate =
121
- object.stablecoinInterestRate !== undefined &&
122
- object.stablecoinInterestRate !== null
123
- ? String(object.stablecoinInterestRate)
124
- : "";
125
113
  message.stablecoinMintCap =
126
114
  object.stablecoinMintCap !== undefined &&
127
115
  object.stablecoinMintCap !== null
@@ -169,8 +157,6 @@ exports.Params = {
169
157
  (obj.interestFee = message.interestFee);
170
158
  message.liquidationFee !== undefined &&
171
159
  (obj.liquidationFee = message.liquidationFee);
172
- message.stablecoinInterestRate !== undefined &&
173
- (obj.stablecoinInterestRate = message.stablecoinInterestRate);
174
160
  message.stablecoinMintCap !== undefined &&
175
161
  (obj.stablecoinMintCap = message.stablecoinMintCap);
176
162
  message.completeLiquidationThreshold !== undefined &&
@@ -192,25 +178,24 @@ exports.Params = {
192
178
  return obj;
193
179
  },
194
180
  fromPartial(object) {
195
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
181
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
196
182
  const message = Object.assign({}, baseParams);
197
183
  message.interestFee = (_a = object.interestFee) !== null && _a !== void 0 ? _a : "";
198
184
  message.liquidationFee = (_b = object.liquidationFee) !== null && _b !== void 0 ? _b : "";
199
- message.stablecoinInterestRate = (_c = object.stablecoinInterestRate) !== null && _c !== void 0 ? _c : "";
200
- message.stablecoinMintCap = (_d = object.stablecoinMintCap) !== null && _d !== void 0 ? _d : "";
185
+ message.stablecoinMintCap = (_c = object.stablecoinMintCap) !== null && _c !== void 0 ? _c : "";
201
186
  message.completeLiquidationThreshold =
202
- (_e = object.completeLiquidationThreshold) !== null && _e !== void 0 ? _e : "";
203
- message.minimumCloseFactor = (_f = object.minimumCloseFactor) !== null && _f !== void 0 ? _f : "";
204
- message.smallLiquidationSize = (_g = object.smallLiquidationSize) !== null && _g !== void 0 ? _g : "";
205
- message.stalePriceGracePeriod = (_h = object.stalePriceGracePeriod) !== null && _h !== void 0 ? _h : "";
206
- message.cdpPaused = (_j = object.cdpPaused) !== null && _j !== void 0 ? _j : false;
187
+ (_d = object.completeLiquidationThreshold) !== null && _d !== void 0 ? _d : "";
188
+ message.minimumCloseFactor = (_e = object.minimumCloseFactor) !== null && _e !== void 0 ? _e : "";
189
+ message.smallLiquidationSize = (_f = object.smallLiquidationSize) !== null && _f !== void 0 ? _f : "";
190
+ message.stalePriceGracePeriod = (_g = object.stalePriceGracePeriod) !== null && _g !== void 0 ? _g : "";
191
+ message.cdpPaused = (_h = object.cdpPaused) !== null && _h !== void 0 ? _h : false;
207
192
  message.stablecoinInterestRateEpoch =
208
193
  object.stablecoinInterestRateEpoch !== undefined &&
209
194
  object.stablecoinInterestRateEpoch !== null
210
195
  ? duration_1.Duration.fromPartial(object.stablecoinInterestRateEpoch)
211
196
  : undefined;
212
197
  message.stablecoinInterestRateAdjusterCoefficient =
213
- (_k = object.stablecoinInterestRateAdjusterCoefficient) !== null && _k !== void 0 ? _k : "";
198
+ (_j = object.stablecoinInterestRateAdjusterCoefficient) !== null && _j !== void 0 ? _j : "";
214
199
  return message;
215
200
  },
216
201
  };
@@ -41,7 +41,6 @@ export interface QueryAccountDataResponse {
41
41
  totalDebtsUsd: string;
42
42
  availableBorrowsUsd: string;
43
43
  currLiquidationThreshold: string;
44
- healthFactor: string;
45
44
  }
46
45
  export interface QueryAccountCollateralRequest {
47
46
  address: string;
@@ -139,6 +138,12 @@ export interface CdpPosition {
139
138
  borrow: Coin[];
140
139
  mint: Coin[];
141
140
  }
141
+ export interface QueryCdpPositionRequest {
142
+ address: string;
143
+ }
144
+ export interface QueryCdpPositionResponse {
145
+ position?: CdpPosition;
146
+ }
142
147
  export interface QueryCdpPositionsRequest {
143
148
  pagination?: PageRequest;
144
149
  maxHealthFactor: string;
@@ -418,6 +423,20 @@ export declare const CdpPosition: {
418
423
  toJSON(message: CdpPosition): unknown;
419
424
  fromPartial(object: DeepPartial<CdpPosition>): CdpPosition;
420
425
  };
426
+ export declare const QueryCdpPositionRequest: {
427
+ encode(message: QueryCdpPositionRequest, writer?: _m0.Writer): _m0.Writer;
428
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCdpPositionRequest;
429
+ fromJSON(object: any): QueryCdpPositionRequest;
430
+ toJSON(message: QueryCdpPositionRequest): unknown;
431
+ fromPartial(object: DeepPartial<QueryCdpPositionRequest>): QueryCdpPositionRequest;
432
+ };
433
+ export declare const QueryCdpPositionResponse: {
434
+ encode(message: QueryCdpPositionResponse, writer?: _m0.Writer): _m0.Writer;
435
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCdpPositionResponse;
436
+ fromJSON(object: any): QueryCdpPositionResponse;
437
+ toJSON(message: QueryCdpPositionResponse): unknown;
438
+ fromPartial(object: DeepPartial<QueryCdpPositionResponse>): QueryCdpPositionResponse;
439
+ };
421
440
  export declare const QueryCdpPositionsRequest: {
422
441
  encode(message: QueryCdpPositionsRequest, writer?: _m0.Writer): _m0.Writer;
423
442
  decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryCdpPositionsRequest;
@@ -575,6 +594,7 @@ export interface Query {
575
594
  RewardDebtsAll(request: QueryRewardDebtsAllRequest): Promise<QueryRewardDebtsResponse>;
576
595
  /** Queries a list of CDP Positions */
577
596
  PositionsAll(request: QueryCdpPositionsRequest): Promise<QueryCdpPositionsResponse>;
597
+ Position(request: QueryCdpPositionRequest): Promise<QueryCdpPositionResponse>;
578
598
  /** Queries a list of EMode items. */
579
599
  EMode(request: QueryEModeRequest): Promise<QueryEModeResponse>;
580
600
  /** Queries a list of EModeAll items. */
@@ -607,6 +627,7 @@ export declare class QueryClientImpl implements Query {
607
627
  RewardDebts(request: QueryRewardDebtsRequest): Promise<QueryRewardDebtsResponse>;
608
628
  RewardDebtsAll(request: QueryRewardDebtsAllRequest): Promise<QueryRewardDebtsResponse>;
609
629
  PositionsAll(request: QueryCdpPositionsRequest): Promise<QueryCdpPositionsResponse>;
630
+ Position(request: QueryCdpPositionRequest): Promise<QueryCdpPositionResponse>;
610
631
  EMode(request: QueryEModeRequest): Promise<QueryEModeResponse>;
611
632
  EModeAll(request: QueryEModeAllRequest): Promise<QueryEModeAllResponse>;
612
633
  AccountEMode(request: QueryAccountEModeRequest): Promise<QueryAccountEModeResponse>;