@aurigami/sdk 0.1.5 → 0.1.6

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.
package/dist/sdk.esm.js CHANGED
@@ -1,5 +1,6 @@
1
- import BigNumber$1 from 'bignumber.js';
2
- import { BigNumber, utils, Contract } from 'ethers';
1
+ import { Token, CurrencyAmount, validateAndParseAddress } from '@pendle/sdk-core';
2
+ import { Contract } from 'ethers';
3
+ import AuToken from '@aurigami/contracts/artifacts/contracts/AuToken.sol/AuToken.json';
3
4
 
4
5
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
5
6
  try {
@@ -841,61 +842,43 @@ var BlockchainEntity = /*#__PURE__*/function () {
841
842
  return BlockchainEntity;
842
843
  }();
843
844
 
844
- var Token = function Token(address, decimals, expiry) {
845
- this.address = address.toLowerCase();
846
- this.decimals = decimals;
847
- this.expiry = expiry;
848
- };
849
-
850
- function formatObject(object) {
851
- return JSON.stringify(object, null, ' ');
852
- }
853
- var decimalFactor = function decimalFactor(decimal) {
854
- return BigNumber.from(10).pow(decimal).toString();
855
- };
856
- function validateAndParseAddress(address) {
857
- try {
858
- return utils.getAddress(address);
859
- } catch (error) {
860
- throw new Error("Invalid address " + address);
861
- }
862
- }
863
-
864
- var TokenAmount = /*#__PURE__*/function () {
865
- function TokenAmount(token, amount, isRaw) {
866
- if (isRaw === void 0) {
867
- isRaw = true;
868
- }
869
-
870
- if (isRaw) {
871
- this.rawAmnt = amount;
872
- } else {
873
- this.rawAmnt = new BigNumber$1(amount).times(decimalFactor(token.decimals)).toFixed(0);
874
- }
875
-
876
- this.token = token;
877
- }
878
-
879
- var _proto = TokenAmount.prototype;
880
-
881
- _proto.formattedAmount = function formattedAmount() {
882
- return new BigNumber$1(this.rawAmnt).div(decimalFactor(this.token.decimals)).toString();
883
- };
884
-
885
- _proto.rawAmount = function rawAmount() {
886
- return this.rawAmnt;
887
- };
888
-
889
- return TokenAmount;
890
- }();
891
-
892
- var dummyToken = /*#__PURE__*/new Token('0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e', 6);
893
- var dummyPly = /*#__PURE__*/new Token('0x8729438eb15e2c8b576fcc6aecda6a148776c0f5', 18);
894
- var dummyPlyAurora = /*#__PURE__*/new Token('0xE530dC2095Ef5653205CF5ea79F8979a7028065c', 18);
895
- var dummyTokenAmount = /*#__PURE__*/new TokenAmount(dummyToken, '123.456', false);
896
- var dummyZeroTokenAmount = /*#__PURE__*/new TokenAmount(dummyToken, '0');
897
- var dummyTokenAmount2 = /*#__PURE__*/new TokenAmount(dummyToken, '456.123', false);
898
- var dummyTokenAmount3 = /*#__PURE__*/new TokenAmount(dummyToken, '1000.123', false);
845
+ var dummyToken = /*#__PURE__*/new Token({
846
+ chainId: 43114,
847
+ decimal: 6,
848
+ symbol: 'USDC',
849
+ address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e'
850
+ });
851
+ var dummyPly = /*#__PURE__*/new Token({
852
+ chainId: 43114,
853
+ decimal: 18,
854
+ symbol: 'QI',
855
+ address: '0x8729438eb15e2c8b576fcc6aecda6a148776c0f5'
856
+ });
857
+ var dummyPlyAurora = /*#__PURE__*/new Token({
858
+ chainId: 43114,
859
+ decimal: 18,
860
+ symbol: 'QIWAVAX',
861
+ address: '0xE530dC2095Ef5653205CF5ea79F8979a7028065c'
862
+ });
863
+ var dummyTokenAmount = /*#__PURE__*/new CurrencyAmount({
864
+ currency: dummyToken,
865
+ amount: '123.456',
866
+ isRaw: false
867
+ });
868
+ var dummyZeroTokenAmount = /*#__PURE__*/new CurrencyAmount({
869
+ currency: dummyToken,
870
+ amount: '0'
871
+ });
872
+ var dummyTokenAmount2 = /*#__PURE__*/new CurrencyAmount({
873
+ currency: dummyToken,
874
+ amount: '456.123',
875
+ isRaw: false
876
+ });
877
+ var dummyTokenAmount3 = /*#__PURE__*/new CurrencyAmount({
878
+ currency: dummyToken,
879
+ amount: '1000.123',
880
+ isRaw: false
881
+ });
899
882
  var dummyMarketAddress = '0xbeb5d47a3f720ec0a390d04b4d41ed7d9688bc7f';
900
883
  var dummyUserMarketDetails = {
901
884
  market: dummyMarketAddress,
@@ -907,7 +890,12 @@ var dummyUserMarketDetails = {
907
890
 
908
891
  var ethers = /*#__PURE__*/require('ethers');
909
892
 
910
- var DOLLAR = /*#__PURE__*/new Token('0x0000000000000000000000000000000000000001', 2);
893
+ var DOLLAR = /*#__PURE__*/new Token({
894
+ chainId: 43114,
895
+ decimal: 2,
896
+ symbol: 'USDC',
897
+ address: '0x0000000000000000000000000000000000000001'
898
+ });
911
899
  var AVAX_DEFAULT_PROVIDER_URL = 'https://api.avax.network/ext/bc/C/rpc';
912
900
  var AVAX_DEFAULT_PROVIDER = /*#__PURE__*/new ethers.providers.JsonRpcProvider(AVAX_DEFAULT_PROVIDER_URL);
913
901
  var dummyPrivateKey = '1111111111111111111111111111111111111111111111111111111111111111';
@@ -960,8 +948,16 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
960
948
  return _context2.abrupt("return", {
961
949
  markets: [dummyUserMarketDetails],
962
950
  borrowLimit: dummyTokenAmount3,
963
- accruedPly: new TokenAmount(dummyPly, '100.12', false),
964
- lockedPly: new TokenAmount(dummyPly, '200.12', false),
951
+ accruedPly: new CurrencyAmount({
952
+ currency: dummyPly,
953
+ amount: '100.12',
954
+ isRaw: false
955
+ }),
956
+ lockedPly: new CurrencyAmount({
957
+ currency: dummyPly,
958
+ amount: '200.12',
959
+ isRaw: false
960
+ }),
965
961
  borrowableAmount: dummyTokenAmount2
966
962
  });
967
963
 
@@ -987,7 +983,11 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
987
983
  switch (_context3.prev = _context3.next) {
988
984
  case 0:
989
985
  return _context3.abrupt("return", {
990
- totalStakedLiquidity: new TokenAmount(dummyPlyAurora, '12.1', false),
986
+ totalStakedLiquidity: new CurrencyAmount({
987
+ currency: dummyPlyAurora,
988
+ amount: '12.1',
989
+ isRaw: false
990
+ }),
991
991
  apy: 1.21
992
992
  });
993
993
 
@@ -1017,10 +1017,18 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
1017
1017
  break;
1018
1018
  }
1019
1019
 
1020
- return _context4.abrupt("return", new TokenAmount(DOLLAR, '1', false));
1020
+ return _context4.abrupt("return", new CurrencyAmount({
1021
+ currency: DOLLAR,
1022
+ amount: '1',
1023
+ isRaw: false
1024
+ }));
1021
1025
 
1022
1026
  case 2:
1023
- return _context4.abrupt("return", new TokenAmount(DOLLAR, '12.1', false));
1027
+ return _context4.abrupt("return", new CurrencyAmount({
1028
+ currency: DOLLAR,
1029
+ amount: '12.1',
1030
+ isRaw: false
1031
+ }));
1024
1032
 
1025
1033
  case 3:
1026
1034
  case "end":
@@ -1043,7 +1051,11 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
1043
1051
  while (1) {
1044
1052
  switch (_context5.prev = _context5.next) {
1045
1053
  case 0:
1046
- return _context5.abrupt("return", new TokenAmount(dummyPlyAurora, '103.4', false));
1054
+ return _context5.abrupt("return", new CurrencyAmount({
1055
+ currency: dummyPlyAurora,
1056
+ amount: '103.4',
1057
+ isRaw: false
1058
+ }));
1047
1059
 
1048
1060
  case 1:
1049
1061
  case "end":
@@ -1179,1571 +1191,6 @@ var SDK = /*#__PURE__*/function (_BlockchainEntity) {
1179
1191
  return SDK;
1180
1192
  }(BlockchainEntity);
1181
1193
 
1182
- var abi = [
1183
- {
1184
- inputs: [
1185
- {
1186
- internalType: "address",
1187
- name: "underlying_",
1188
- type: "address"
1189
- },
1190
- {
1191
- internalType: "contract ComptrollerInterface",
1192
- name: "comptroller_",
1193
- type: "address"
1194
- },
1195
- {
1196
- internalType: "contract InterestRateModel",
1197
- name: "interestRateModel_",
1198
- type: "address"
1199
- },
1200
- {
1201
- internalType: "uint256",
1202
- name: "initialExchangeRateMantissa_",
1203
- type: "uint256"
1204
- },
1205
- {
1206
- internalType: "string",
1207
- name: "name_",
1208
- type: "string"
1209
- },
1210
- {
1211
- internalType: "string",
1212
- name: "symbol_",
1213
- type: "string"
1214
- },
1215
- {
1216
- internalType: "uint8",
1217
- name: "decimals_",
1218
- type: "uint8"
1219
- },
1220
- {
1221
- internalType: "address payable",
1222
- name: "admin_",
1223
- type: "address"
1224
- },
1225
- {
1226
- internalType: "address",
1227
- name: "implementation_",
1228
- type: "address"
1229
- },
1230
- {
1231
- internalType: "bytes",
1232
- name: "becomeImplementationData",
1233
- type: "bytes"
1234
- }
1235
- ],
1236
- payable: false,
1237
- stateMutability: "nonpayable",
1238
- type: "constructor"
1239
- },
1240
- {
1241
- anonymous: false,
1242
- inputs: [
1243
- {
1244
- indexed: false,
1245
- internalType: "uint256",
1246
- name: "cashPrior",
1247
- type: "uint256"
1248
- },
1249
- {
1250
- indexed: false,
1251
- internalType: "uint256",
1252
- name: "interestAccumulated",
1253
- type: "uint256"
1254
- },
1255
- {
1256
- indexed: false,
1257
- internalType: "uint256",
1258
- name: "borrowIndex",
1259
- type: "uint256"
1260
- },
1261
- {
1262
- indexed: false,
1263
- internalType: "uint256",
1264
- name: "totalBorrows",
1265
- type: "uint256"
1266
- }
1267
- ],
1268
- name: "AccrueInterest",
1269
- type: "event"
1270
- },
1271
- {
1272
- anonymous: false,
1273
- inputs: [
1274
- {
1275
- indexed: true,
1276
- internalType: "address",
1277
- name: "owner",
1278
- type: "address"
1279
- },
1280
- {
1281
- indexed: true,
1282
- internalType: "address",
1283
- name: "spender",
1284
- type: "address"
1285
- },
1286
- {
1287
- indexed: false,
1288
- internalType: "uint256",
1289
- name: "amount",
1290
- type: "uint256"
1291
- }
1292
- ],
1293
- name: "Approval",
1294
- type: "event"
1295
- },
1296
- {
1297
- anonymous: false,
1298
- inputs: [
1299
- {
1300
- indexed: false,
1301
- internalType: "address",
1302
- name: "borrower",
1303
- type: "address"
1304
- },
1305
- {
1306
- indexed: false,
1307
- internalType: "uint256",
1308
- name: "borrowAmount",
1309
- type: "uint256"
1310
- },
1311
- {
1312
- indexed: false,
1313
- internalType: "uint256",
1314
- name: "accountBorrows",
1315
- type: "uint256"
1316
- },
1317
- {
1318
- indexed: false,
1319
- internalType: "uint256",
1320
- name: "totalBorrows",
1321
- type: "uint256"
1322
- }
1323
- ],
1324
- name: "Borrow",
1325
- type: "event"
1326
- },
1327
- {
1328
- anonymous: false,
1329
- inputs: [
1330
- {
1331
- indexed: false,
1332
- internalType: "uint256",
1333
- name: "error",
1334
- type: "uint256"
1335
- },
1336
- {
1337
- indexed: false,
1338
- internalType: "uint256",
1339
- name: "info",
1340
- type: "uint256"
1341
- },
1342
- {
1343
- indexed: false,
1344
- internalType: "uint256",
1345
- name: "detail",
1346
- type: "uint256"
1347
- }
1348
- ],
1349
- name: "Failure",
1350
- type: "event"
1351
- },
1352
- {
1353
- anonymous: false,
1354
- inputs: [
1355
- {
1356
- indexed: false,
1357
- internalType: "address",
1358
- name: "liquidator",
1359
- type: "address"
1360
- },
1361
- {
1362
- indexed: false,
1363
- internalType: "address",
1364
- name: "borrower",
1365
- type: "address"
1366
- },
1367
- {
1368
- indexed: false,
1369
- internalType: "uint256",
1370
- name: "repayAmount",
1371
- type: "uint256"
1372
- },
1373
- {
1374
- indexed: false,
1375
- internalType: "address",
1376
- name: "qiTokenCollateral",
1377
- type: "address"
1378
- },
1379
- {
1380
- indexed: false,
1381
- internalType: "uint256",
1382
- name: "seizeTokens",
1383
- type: "uint256"
1384
- }
1385
- ],
1386
- name: "LiquidateBorrow",
1387
- type: "event"
1388
- },
1389
- {
1390
- anonymous: false,
1391
- inputs: [
1392
- {
1393
- indexed: false,
1394
- internalType: "address",
1395
- name: "minter",
1396
- type: "address"
1397
- },
1398
- {
1399
- indexed: false,
1400
- internalType: "uint256",
1401
- name: "mintAmount",
1402
- type: "uint256"
1403
- },
1404
- {
1405
- indexed: false,
1406
- internalType: "uint256",
1407
- name: "mintTokens",
1408
- type: "uint256"
1409
- }
1410
- ],
1411
- name: "Mint",
1412
- type: "event"
1413
- },
1414
- {
1415
- anonymous: false,
1416
- inputs: [
1417
- {
1418
- indexed: false,
1419
- internalType: "address",
1420
- name: "oldAdmin",
1421
- type: "address"
1422
- },
1423
- {
1424
- indexed: false,
1425
- internalType: "address",
1426
- name: "newAdmin",
1427
- type: "address"
1428
- }
1429
- ],
1430
- name: "NewAdmin",
1431
- type: "event"
1432
- },
1433
- {
1434
- anonymous: false,
1435
- inputs: [
1436
- {
1437
- indexed: false,
1438
- internalType: "contract ComptrollerInterface",
1439
- name: "oldComptroller",
1440
- type: "address"
1441
- },
1442
- {
1443
- indexed: false,
1444
- internalType: "contract ComptrollerInterface",
1445
- name: "newComptroller",
1446
- type: "address"
1447
- }
1448
- ],
1449
- name: "NewComptroller",
1450
- type: "event"
1451
- },
1452
- {
1453
- anonymous: false,
1454
- inputs: [
1455
- {
1456
- indexed: false,
1457
- internalType: "address",
1458
- name: "oldImplementation",
1459
- type: "address"
1460
- },
1461
- {
1462
- indexed: false,
1463
- internalType: "address",
1464
- name: "newImplementation",
1465
- type: "address"
1466
- }
1467
- ],
1468
- name: "NewImplementation",
1469
- type: "event"
1470
- },
1471
- {
1472
- anonymous: false,
1473
- inputs: [
1474
- {
1475
- indexed: false,
1476
- internalType: "contract InterestRateModel",
1477
- name: "oldInterestRateModel",
1478
- type: "address"
1479
- },
1480
- {
1481
- indexed: false,
1482
- internalType: "contract InterestRateModel",
1483
- name: "newInterestRateModel",
1484
- type: "address"
1485
- }
1486
- ],
1487
- name: "NewMarketInterestRateModel",
1488
- type: "event"
1489
- },
1490
- {
1491
- anonymous: false,
1492
- inputs: [
1493
- {
1494
- indexed: false,
1495
- internalType: "address",
1496
- name: "oldPendingAdmin",
1497
- type: "address"
1498
- },
1499
- {
1500
- indexed: false,
1501
- internalType: "address",
1502
- name: "newPendingAdmin",
1503
- type: "address"
1504
- }
1505
- ],
1506
- name: "NewPendingAdmin",
1507
- type: "event"
1508
- },
1509
- {
1510
- anonymous: false,
1511
- inputs: [
1512
- {
1513
- indexed: false,
1514
- internalType: "uint256",
1515
- name: "oldProtocolSeizeShareMantissa",
1516
- type: "uint256"
1517
- },
1518
- {
1519
- indexed: false,
1520
- internalType: "uint256",
1521
- name: "newProtocolSeizeShareMantissa",
1522
- type: "uint256"
1523
- }
1524
- ],
1525
- name: "NewProtocolSeizeShare",
1526
- type: "event"
1527
- },
1528
- {
1529
- anonymous: false,
1530
- inputs: [
1531
- {
1532
- indexed: false,
1533
- internalType: "uint256",
1534
- name: "oldReserveFactorMantissa",
1535
- type: "uint256"
1536
- },
1537
- {
1538
- indexed: false,
1539
- internalType: "uint256",
1540
- name: "newReserveFactorMantissa",
1541
- type: "uint256"
1542
- }
1543
- ],
1544
- name: "NewReserveFactor",
1545
- type: "event"
1546
- },
1547
- {
1548
- anonymous: false,
1549
- inputs: [
1550
- {
1551
- indexed: false,
1552
- internalType: "address",
1553
- name: "redeemer",
1554
- type: "address"
1555
- },
1556
- {
1557
- indexed: false,
1558
- internalType: "uint256",
1559
- name: "redeemAmount",
1560
- type: "uint256"
1561
- },
1562
- {
1563
- indexed: false,
1564
- internalType: "uint256",
1565
- name: "redeemTokens",
1566
- type: "uint256"
1567
- }
1568
- ],
1569
- name: "Redeem",
1570
- type: "event"
1571
- },
1572
- {
1573
- anonymous: false,
1574
- inputs: [
1575
- {
1576
- indexed: false,
1577
- internalType: "address",
1578
- name: "payer",
1579
- type: "address"
1580
- },
1581
- {
1582
- indexed: false,
1583
- internalType: "address",
1584
- name: "borrower",
1585
- type: "address"
1586
- },
1587
- {
1588
- indexed: false,
1589
- internalType: "uint256",
1590
- name: "repayAmount",
1591
- type: "uint256"
1592
- },
1593
- {
1594
- indexed: false,
1595
- internalType: "uint256",
1596
- name: "accountBorrows",
1597
- type: "uint256"
1598
- },
1599
- {
1600
- indexed: false,
1601
- internalType: "uint256",
1602
- name: "totalBorrows",
1603
- type: "uint256"
1604
- }
1605
- ],
1606
- name: "RepayBorrow",
1607
- type: "event"
1608
- },
1609
- {
1610
- anonymous: false,
1611
- inputs: [
1612
- {
1613
- indexed: false,
1614
- internalType: "address",
1615
- name: "benefactor",
1616
- type: "address"
1617
- },
1618
- {
1619
- indexed: false,
1620
- internalType: "uint256",
1621
- name: "addAmount",
1622
- type: "uint256"
1623
- },
1624
- {
1625
- indexed: false,
1626
- internalType: "uint256",
1627
- name: "newTotalReserves",
1628
- type: "uint256"
1629
- }
1630
- ],
1631
- name: "ReservesAdded",
1632
- type: "event"
1633
- },
1634
- {
1635
- anonymous: false,
1636
- inputs: [
1637
- {
1638
- indexed: false,
1639
- internalType: "address",
1640
- name: "admin",
1641
- type: "address"
1642
- },
1643
- {
1644
- indexed: false,
1645
- internalType: "uint256",
1646
- name: "reduceAmount",
1647
- type: "uint256"
1648
- },
1649
- {
1650
- indexed: false,
1651
- internalType: "uint256",
1652
- name: "newTotalReserves",
1653
- type: "uint256"
1654
- }
1655
- ],
1656
- name: "ReservesReduced",
1657
- type: "event"
1658
- },
1659
- {
1660
- anonymous: false,
1661
- inputs: [
1662
- {
1663
- indexed: true,
1664
- internalType: "address",
1665
- name: "from",
1666
- type: "address"
1667
- },
1668
- {
1669
- indexed: true,
1670
- internalType: "address",
1671
- name: "to",
1672
- type: "address"
1673
- },
1674
- {
1675
- indexed: false,
1676
- internalType: "uint256",
1677
- name: "amount",
1678
- type: "uint256"
1679
- }
1680
- ],
1681
- name: "Transfer",
1682
- type: "event"
1683
- },
1684
- {
1685
- payable: true,
1686
- stateMutability: "payable",
1687
- type: "fallback"
1688
- },
1689
- {
1690
- constant: false,
1691
- inputs: [
1692
- ],
1693
- name: "_acceptAdmin",
1694
- outputs: [
1695
- {
1696
- internalType: "uint256",
1697
- name: "",
1698
- type: "uint256"
1699
- }
1700
- ],
1701
- payable: false,
1702
- stateMutability: "nonpayable",
1703
- type: "function"
1704
- },
1705
- {
1706
- constant: false,
1707
- inputs: [
1708
- {
1709
- internalType: "uint256",
1710
- name: "addAmount",
1711
- type: "uint256"
1712
- }
1713
- ],
1714
- name: "_addReserves",
1715
- outputs: [
1716
- {
1717
- internalType: "uint256",
1718
- name: "",
1719
- type: "uint256"
1720
- }
1721
- ],
1722
- payable: false,
1723
- stateMutability: "nonpayable",
1724
- type: "function"
1725
- },
1726
- {
1727
- constant: false,
1728
- inputs: [
1729
- {
1730
- internalType: "uint256",
1731
- name: "reduceAmount",
1732
- type: "uint256"
1733
- }
1734
- ],
1735
- name: "_reduceReserves",
1736
- outputs: [
1737
- {
1738
- internalType: "uint256",
1739
- name: "",
1740
- type: "uint256"
1741
- }
1742
- ],
1743
- payable: false,
1744
- stateMutability: "nonpayable",
1745
- type: "function"
1746
- },
1747
- {
1748
- constant: false,
1749
- inputs: [
1750
- {
1751
- internalType: "contract ComptrollerInterface",
1752
- name: "newComptroller",
1753
- type: "address"
1754
- }
1755
- ],
1756
- name: "_setComptroller",
1757
- outputs: [
1758
- {
1759
- internalType: "uint256",
1760
- name: "",
1761
- type: "uint256"
1762
- }
1763
- ],
1764
- payable: false,
1765
- stateMutability: "nonpayable",
1766
- type: "function"
1767
- },
1768
- {
1769
- constant: false,
1770
- inputs: [
1771
- {
1772
- internalType: "address",
1773
- name: "implementation_",
1774
- type: "address"
1775
- },
1776
- {
1777
- internalType: "bool",
1778
- name: "allowResign",
1779
- type: "bool"
1780
- },
1781
- {
1782
- internalType: "bytes",
1783
- name: "becomeImplementationData",
1784
- type: "bytes"
1785
- }
1786
- ],
1787
- name: "_setImplementation",
1788
- outputs: [
1789
- ],
1790
- payable: false,
1791
- stateMutability: "nonpayable",
1792
- type: "function"
1793
- },
1794
- {
1795
- constant: false,
1796
- inputs: [
1797
- {
1798
- internalType: "contract InterestRateModel",
1799
- name: "newInterestRateModel",
1800
- type: "address"
1801
- }
1802
- ],
1803
- name: "_setInterestRateModel",
1804
- outputs: [
1805
- {
1806
- internalType: "uint256",
1807
- name: "",
1808
- type: "uint256"
1809
- }
1810
- ],
1811
- payable: false,
1812
- stateMutability: "nonpayable",
1813
- type: "function"
1814
- },
1815
- {
1816
- constant: false,
1817
- inputs: [
1818
- {
1819
- internalType: "address payable",
1820
- name: "newPendingAdmin",
1821
- type: "address"
1822
- }
1823
- ],
1824
- name: "_setPendingAdmin",
1825
- outputs: [
1826
- {
1827
- internalType: "uint256",
1828
- name: "",
1829
- type: "uint256"
1830
- }
1831
- ],
1832
- payable: false,
1833
- stateMutability: "nonpayable",
1834
- type: "function"
1835
- },
1836
- {
1837
- constant: false,
1838
- inputs: [
1839
- {
1840
- internalType: "uint256",
1841
- name: "newProtocolSeizeShareMantissa",
1842
- type: "uint256"
1843
- }
1844
- ],
1845
- name: "_setProtocolSeizeShare",
1846
- outputs: [
1847
- {
1848
- internalType: "uint256",
1849
- name: "",
1850
- type: "uint256"
1851
- }
1852
- ],
1853
- payable: false,
1854
- stateMutability: "nonpayable",
1855
- type: "function"
1856
- },
1857
- {
1858
- constant: false,
1859
- inputs: [
1860
- {
1861
- internalType: "uint256",
1862
- name: "newReserveFactorMantissa",
1863
- type: "uint256"
1864
- }
1865
- ],
1866
- name: "_setReserveFactor",
1867
- outputs: [
1868
- {
1869
- internalType: "uint256",
1870
- name: "",
1871
- type: "uint256"
1872
- }
1873
- ],
1874
- payable: false,
1875
- stateMutability: "nonpayable",
1876
- type: "function"
1877
- },
1878
- {
1879
- constant: true,
1880
- inputs: [
1881
- ],
1882
- name: "accrualBlockTimestamp",
1883
- outputs: [
1884
- {
1885
- internalType: "uint256",
1886
- name: "",
1887
- type: "uint256"
1888
- }
1889
- ],
1890
- payable: false,
1891
- stateMutability: "view",
1892
- type: "function"
1893
- },
1894
- {
1895
- constant: false,
1896
- inputs: [
1897
- ],
1898
- name: "accrueInterest",
1899
- outputs: [
1900
- {
1901
- internalType: "uint256",
1902
- name: "",
1903
- type: "uint256"
1904
- }
1905
- ],
1906
- payable: false,
1907
- stateMutability: "nonpayable",
1908
- type: "function"
1909
- },
1910
- {
1911
- constant: true,
1912
- inputs: [
1913
- ],
1914
- name: "admin",
1915
- outputs: [
1916
- {
1917
- internalType: "address payable",
1918
- name: "",
1919
- type: "address"
1920
- }
1921
- ],
1922
- payable: false,
1923
- stateMutability: "view",
1924
- type: "function"
1925
- },
1926
- {
1927
- constant: true,
1928
- inputs: [
1929
- {
1930
- internalType: "address",
1931
- name: "owner",
1932
- type: "address"
1933
- },
1934
- {
1935
- internalType: "address",
1936
- name: "spender",
1937
- type: "address"
1938
- }
1939
- ],
1940
- name: "allowance",
1941
- outputs: [
1942
- {
1943
- internalType: "uint256",
1944
- name: "",
1945
- type: "uint256"
1946
- }
1947
- ],
1948
- payable: false,
1949
- stateMutability: "view",
1950
- type: "function"
1951
- },
1952
- {
1953
- constant: false,
1954
- inputs: [
1955
- {
1956
- internalType: "address",
1957
- name: "spender",
1958
- type: "address"
1959
- },
1960
- {
1961
- internalType: "uint256",
1962
- name: "amount",
1963
- type: "uint256"
1964
- }
1965
- ],
1966
- name: "approve",
1967
- outputs: [
1968
- {
1969
- internalType: "bool",
1970
- name: "",
1971
- type: "bool"
1972
- }
1973
- ],
1974
- payable: false,
1975
- stateMutability: "nonpayable",
1976
- type: "function"
1977
- },
1978
- {
1979
- constant: true,
1980
- inputs: [
1981
- {
1982
- internalType: "address",
1983
- name: "owner",
1984
- type: "address"
1985
- }
1986
- ],
1987
- name: "balanceOf",
1988
- outputs: [
1989
- {
1990
- internalType: "uint256",
1991
- name: "",
1992
- type: "uint256"
1993
- }
1994
- ],
1995
- payable: false,
1996
- stateMutability: "view",
1997
- type: "function"
1998
- },
1999
- {
2000
- constant: false,
2001
- inputs: [
2002
- {
2003
- internalType: "address",
2004
- name: "owner",
2005
- type: "address"
2006
- }
2007
- ],
2008
- name: "balanceOfUnderlying",
2009
- outputs: [
2010
- {
2011
- internalType: "uint256",
2012
- name: "",
2013
- type: "uint256"
2014
- }
2015
- ],
2016
- payable: false,
2017
- stateMutability: "nonpayable",
2018
- type: "function"
2019
- },
2020
- {
2021
- constant: false,
2022
- inputs: [
2023
- {
2024
- internalType: "uint256",
2025
- name: "borrowAmount",
2026
- type: "uint256"
2027
- }
2028
- ],
2029
- name: "borrow",
2030
- outputs: [
2031
- {
2032
- internalType: "uint256",
2033
- name: "",
2034
- type: "uint256"
2035
- }
2036
- ],
2037
- payable: false,
2038
- stateMutability: "nonpayable",
2039
- type: "function"
2040
- },
2041
- {
2042
- constant: false,
2043
- inputs: [
2044
- {
2045
- internalType: "address",
2046
- name: "account",
2047
- type: "address"
2048
- }
2049
- ],
2050
- name: "borrowBalanceCurrent",
2051
- outputs: [
2052
- {
2053
- internalType: "uint256",
2054
- name: "",
2055
- type: "uint256"
2056
- }
2057
- ],
2058
- payable: false,
2059
- stateMutability: "nonpayable",
2060
- type: "function"
2061
- },
2062
- {
2063
- constant: true,
2064
- inputs: [
2065
- {
2066
- internalType: "address",
2067
- name: "account",
2068
- type: "address"
2069
- }
2070
- ],
2071
- name: "borrowBalanceStored",
2072
- outputs: [
2073
- {
2074
- internalType: "uint256",
2075
- name: "",
2076
- type: "uint256"
2077
- }
2078
- ],
2079
- payable: false,
2080
- stateMutability: "view",
2081
- type: "function"
2082
- },
2083
- {
2084
- constant: true,
2085
- inputs: [
2086
- ],
2087
- name: "borrowIndex",
2088
- outputs: [
2089
- {
2090
- internalType: "uint256",
2091
- name: "",
2092
- type: "uint256"
2093
- }
2094
- ],
2095
- payable: false,
2096
- stateMutability: "view",
2097
- type: "function"
2098
- },
2099
- {
2100
- constant: true,
2101
- inputs: [
2102
- ],
2103
- name: "borrowRatePerTimestamp",
2104
- outputs: [
2105
- {
2106
- internalType: "uint256",
2107
- name: "",
2108
- type: "uint256"
2109
- }
2110
- ],
2111
- payable: false,
2112
- stateMutability: "view",
2113
- type: "function"
2114
- },
2115
- {
2116
- constant: true,
2117
- inputs: [
2118
- ],
2119
- name: "comptroller",
2120
- outputs: [
2121
- {
2122
- internalType: "contract ComptrollerInterface",
2123
- name: "",
2124
- type: "address"
2125
- }
2126
- ],
2127
- payable: false,
2128
- stateMutability: "view",
2129
- type: "function"
2130
- },
2131
- {
2132
- constant: true,
2133
- inputs: [
2134
- ],
2135
- name: "decimals",
2136
- outputs: [
2137
- {
2138
- internalType: "uint8",
2139
- name: "",
2140
- type: "uint8"
2141
- }
2142
- ],
2143
- payable: false,
2144
- stateMutability: "view",
2145
- type: "function"
2146
- },
2147
- {
2148
- constant: false,
2149
- inputs: [
2150
- {
2151
- internalType: "bytes",
2152
- name: "data",
2153
- type: "bytes"
2154
- }
2155
- ],
2156
- name: "delegateToImplementation",
2157
- outputs: [
2158
- {
2159
- internalType: "bytes",
2160
- name: "",
2161
- type: "bytes"
2162
- }
2163
- ],
2164
- payable: false,
2165
- stateMutability: "nonpayable",
2166
- type: "function"
2167
- },
2168
- {
2169
- constant: true,
2170
- inputs: [
2171
- {
2172
- internalType: "bytes",
2173
- name: "data",
2174
- type: "bytes"
2175
- }
2176
- ],
2177
- name: "delegateToViewImplementation",
2178
- outputs: [
2179
- {
2180
- internalType: "bytes",
2181
- name: "",
2182
- type: "bytes"
2183
- }
2184
- ],
2185
- payable: false,
2186
- stateMutability: "view",
2187
- type: "function"
2188
- },
2189
- {
2190
- constant: false,
2191
- inputs: [
2192
- ],
2193
- name: "exchangeRateCurrent",
2194
- outputs: [
2195
- {
2196
- internalType: "uint256",
2197
- name: "",
2198
- type: "uint256"
2199
- }
2200
- ],
2201
- payable: false,
2202
- stateMutability: "nonpayable",
2203
- type: "function"
2204
- },
2205
- {
2206
- constant: true,
2207
- inputs: [
2208
- ],
2209
- name: "exchangeRateStored",
2210
- outputs: [
2211
- {
2212
- internalType: "uint256",
2213
- name: "",
2214
- type: "uint256"
2215
- }
2216
- ],
2217
- payable: false,
2218
- stateMutability: "view",
2219
- type: "function"
2220
- },
2221
- {
2222
- constant: true,
2223
- inputs: [
2224
- {
2225
- internalType: "address",
2226
- name: "account",
2227
- type: "address"
2228
- }
2229
- ],
2230
- name: "getAccountSnapshot",
2231
- outputs: [
2232
- {
2233
- internalType: "uint256",
2234
- name: "",
2235
- type: "uint256"
2236
- },
2237
- {
2238
- internalType: "uint256",
2239
- name: "",
2240
- type: "uint256"
2241
- },
2242
- {
2243
- internalType: "uint256",
2244
- name: "",
2245
- type: "uint256"
2246
- },
2247
- {
2248
- internalType: "uint256",
2249
- name: "",
2250
- type: "uint256"
2251
- }
2252
- ],
2253
- payable: false,
2254
- stateMutability: "view",
2255
- type: "function"
2256
- },
2257
- {
2258
- constant: true,
2259
- inputs: [
2260
- ],
2261
- name: "getCash",
2262
- outputs: [
2263
- {
2264
- internalType: "uint256",
2265
- name: "",
2266
- type: "uint256"
2267
- }
2268
- ],
2269
- payable: false,
2270
- stateMutability: "view",
2271
- type: "function"
2272
- },
2273
- {
2274
- constant: true,
2275
- inputs: [
2276
- ],
2277
- name: "implementation",
2278
- outputs: [
2279
- {
2280
- internalType: "address",
2281
- name: "",
2282
- type: "address"
2283
- }
2284
- ],
2285
- payable: false,
2286
- stateMutability: "view",
2287
- type: "function"
2288
- },
2289
- {
2290
- constant: true,
2291
- inputs: [
2292
- ],
2293
- name: "interestRateModel",
2294
- outputs: [
2295
- {
2296
- internalType: "contract InterestRateModel",
2297
- name: "",
2298
- type: "address"
2299
- }
2300
- ],
2301
- payable: false,
2302
- stateMutability: "view",
2303
- type: "function"
2304
- },
2305
- {
2306
- constant: true,
2307
- inputs: [
2308
- ],
2309
- name: "isQiToken",
2310
- outputs: [
2311
- {
2312
- internalType: "bool",
2313
- name: "",
2314
- type: "bool"
2315
- }
2316
- ],
2317
- payable: false,
2318
- stateMutability: "view",
2319
- type: "function"
2320
- },
2321
- {
2322
- constant: false,
2323
- inputs: [
2324
- {
2325
- internalType: "address",
2326
- name: "borrower",
2327
- type: "address"
2328
- },
2329
- {
2330
- internalType: "uint256",
2331
- name: "repayAmount",
2332
- type: "uint256"
2333
- },
2334
- {
2335
- internalType: "contract QiTokenInterface",
2336
- name: "qiTokenCollateral",
2337
- type: "address"
2338
- }
2339
- ],
2340
- name: "liquidateBorrow",
2341
- outputs: [
2342
- {
2343
- internalType: "uint256",
2344
- name: "",
2345
- type: "uint256"
2346
- }
2347
- ],
2348
- payable: false,
2349
- stateMutability: "nonpayable",
2350
- type: "function"
2351
- },
2352
- {
2353
- constant: false,
2354
- inputs: [
2355
- {
2356
- internalType: "uint256",
2357
- name: "mintAmount",
2358
- type: "uint256"
2359
- }
2360
- ],
2361
- name: "mint",
2362
- outputs: [
2363
- {
2364
- internalType: "uint256",
2365
- name: "",
2366
- type: "uint256"
2367
- }
2368
- ],
2369
- payable: false,
2370
- stateMutability: "nonpayable",
2371
- type: "function"
2372
- },
2373
- {
2374
- constant: true,
2375
- inputs: [
2376
- ],
2377
- name: "name",
2378
- outputs: [
2379
- {
2380
- internalType: "string",
2381
- name: "",
2382
- type: "string"
2383
- }
2384
- ],
2385
- payable: false,
2386
- stateMutability: "view",
2387
- type: "function"
2388
- },
2389
- {
2390
- constant: true,
2391
- inputs: [
2392
- ],
2393
- name: "pendingAdmin",
2394
- outputs: [
2395
- {
2396
- internalType: "address payable",
2397
- name: "",
2398
- type: "address"
2399
- }
2400
- ],
2401
- payable: false,
2402
- stateMutability: "view",
2403
- type: "function"
2404
- },
2405
- {
2406
- constant: true,
2407
- inputs: [
2408
- ],
2409
- name: "protocolSeizeShareMantissa",
2410
- outputs: [
2411
- {
2412
- internalType: "uint256",
2413
- name: "",
2414
- type: "uint256"
2415
- }
2416
- ],
2417
- payable: false,
2418
- stateMutability: "view",
2419
- type: "function"
2420
- },
2421
- {
2422
- constant: false,
2423
- inputs: [
2424
- {
2425
- internalType: "uint256",
2426
- name: "redeemTokens",
2427
- type: "uint256"
2428
- }
2429
- ],
2430
- name: "redeem",
2431
- outputs: [
2432
- {
2433
- internalType: "uint256",
2434
- name: "",
2435
- type: "uint256"
2436
- }
2437
- ],
2438
- payable: false,
2439
- stateMutability: "nonpayable",
2440
- type: "function"
2441
- },
2442
- {
2443
- constant: false,
2444
- inputs: [
2445
- {
2446
- internalType: "uint256",
2447
- name: "redeemAmount",
2448
- type: "uint256"
2449
- }
2450
- ],
2451
- name: "redeemUnderlying",
2452
- outputs: [
2453
- {
2454
- internalType: "uint256",
2455
- name: "",
2456
- type: "uint256"
2457
- }
2458
- ],
2459
- payable: false,
2460
- stateMutability: "nonpayable",
2461
- type: "function"
2462
- },
2463
- {
2464
- constant: false,
2465
- inputs: [
2466
- {
2467
- internalType: "uint256",
2468
- name: "repayAmount",
2469
- type: "uint256"
2470
- }
2471
- ],
2472
- name: "repayBorrow",
2473
- outputs: [
2474
- {
2475
- internalType: "uint256",
2476
- name: "",
2477
- type: "uint256"
2478
- }
2479
- ],
2480
- payable: false,
2481
- stateMutability: "nonpayable",
2482
- type: "function"
2483
- },
2484
- {
2485
- constant: false,
2486
- inputs: [
2487
- {
2488
- internalType: "address",
2489
- name: "borrower",
2490
- type: "address"
2491
- },
2492
- {
2493
- internalType: "uint256",
2494
- name: "repayAmount",
2495
- type: "uint256"
2496
- }
2497
- ],
2498
- name: "repayBorrowBehalf",
2499
- outputs: [
2500
- {
2501
- internalType: "uint256",
2502
- name: "",
2503
- type: "uint256"
2504
- }
2505
- ],
2506
- payable: false,
2507
- stateMutability: "nonpayable",
2508
- type: "function"
2509
- },
2510
- {
2511
- constant: true,
2512
- inputs: [
2513
- ],
2514
- name: "reserveFactorMantissa",
2515
- outputs: [
2516
- {
2517
- internalType: "uint256",
2518
- name: "",
2519
- type: "uint256"
2520
- }
2521
- ],
2522
- payable: false,
2523
- stateMutability: "view",
2524
- type: "function"
2525
- },
2526
- {
2527
- constant: false,
2528
- inputs: [
2529
- {
2530
- internalType: "address",
2531
- name: "liquidator",
2532
- type: "address"
2533
- },
2534
- {
2535
- internalType: "address",
2536
- name: "borrower",
2537
- type: "address"
2538
- },
2539
- {
2540
- internalType: "uint256",
2541
- name: "seizeTokens",
2542
- type: "uint256"
2543
- }
2544
- ],
2545
- name: "seize",
2546
- outputs: [
2547
- {
2548
- internalType: "uint256",
2549
- name: "",
2550
- type: "uint256"
2551
- }
2552
- ],
2553
- payable: false,
2554
- stateMutability: "nonpayable",
2555
- type: "function"
2556
- },
2557
- {
2558
- constant: true,
2559
- inputs: [
2560
- ],
2561
- name: "supplyRatePerTimestamp",
2562
- outputs: [
2563
- {
2564
- internalType: "uint256",
2565
- name: "",
2566
- type: "uint256"
2567
- }
2568
- ],
2569
- payable: false,
2570
- stateMutability: "view",
2571
- type: "function"
2572
- },
2573
- {
2574
- constant: false,
2575
- inputs: [
2576
- {
2577
- internalType: "contract EIP20NonStandardInterface",
2578
- name: "token",
2579
- type: "address"
2580
- }
2581
- ],
2582
- name: "sweepToken",
2583
- outputs: [
2584
- ],
2585
- payable: false,
2586
- stateMutability: "nonpayable",
2587
- type: "function"
2588
- },
2589
- {
2590
- constant: true,
2591
- inputs: [
2592
- ],
2593
- name: "symbol",
2594
- outputs: [
2595
- {
2596
- internalType: "string",
2597
- name: "",
2598
- type: "string"
2599
- }
2600
- ],
2601
- payable: false,
2602
- stateMutability: "view",
2603
- type: "function"
2604
- },
2605
- {
2606
- constant: true,
2607
- inputs: [
2608
- ],
2609
- name: "totalBorrows",
2610
- outputs: [
2611
- {
2612
- internalType: "uint256",
2613
- name: "",
2614
- type: "uint256"
2615
- }
2616
- ],
2617
- payable: false,
2618
- stateMutability: "view",
2619
- type: "function"
2620
- },
2621
- {
2622
- constant: false,
2623
- inputs: [
2624
- ],
2625
- name: "totalBorrowsCurrent",
2626
- outputs: [
2627
- {
2628
- internalType: "uint256",
2629
- name: "",
2630
- type: "uint256"
2631
- }
2632
- ],
2633
- payable: false,
2634
- stateMutability: "nonpayable",
2635
- type: "function"
2636
- },
2637
- {
2638
- constant: true,
2639
- inputs: [
2640
- ],
2641
- name: "totalReserves",
2642
- outputs: [
2643
- {
2644
- internalType: "uint256",
2645
- name: "",
2646
- type: "uint256"
2647
- }
2648
- ],
2649
- payable: false,
2650
- stateMutability: "view",
2651
- type: "function"
2652
- },
2653
- {
2654
- constant: true,
2655
- inputs: [
2656
- ],
2657
- name: "totalSupply",
2658
- outputs: [
2659
- {
2660
- internalType: "uint256",
2661
- name: "",
2662
- type: "uint256"
2663
- }
2664
- ],
2665
- payable: false,
2666
- stateMutability: "view",
2667
- type: "function"
2668
- },
2669
- {
2670
- constant: false,
2671
- inputs: [
2672
- {
2673
- internalType: "address",
2674
- name: "dst",
2675
- type: "address"
2676
- },
2677
- {
2678
- internalType: "uint256",
2679
- name: "amount",
2680
- type: "uint256"
2681
- }
2682
- ],
2683
- name: "transfer",
2684
- outputs: [
2685
- {
2686
- internalType: "bool",
2687
- name: "",
2688
- type: "bool"
2689
- }
2690
- ],
2691
- payable: false,
2692
- stateMutability: "nonpayable",
2693
- type: "function"
2694
- },
2695
- {
2696
- constant: false,
2697
- inputs: [
2698
- {
2699
- internalType: "address",
2700
- name: "src",
2701
- type: "address"
2702
- },
2703
- {
2704
- internalType: "address",
2705
- name: "dst",
2706
- type: "address"
2707
- },
2708
- {
2709
- internalType: "uint256",
2710
- name: "amount",
2711
- type: "uint256"
2712
- }
2713
- ],
2714
- name: "transferFrom",
2715
- outputs: [
2716
- {
2717
- internalType: "bool",
2718
- name: "",
2719
- type: "bool"
2720
- }
2721
- ],
2722
- payable: false,
2723
- stateMutability: "nonpayable",
2724
- type: "function"
2725
- },
2726
- {
2727
- constant: true,
2728
- inputs: [
2729
- ],
2730
- name: "underlying",
2731
- outputs: [
2732
- {
2733
- internalType: "address",
2734
- name: "",
2735
- type: "address"
2736
- }
2737
- ],
2738
- payable: false,
2739
- stateMutability: "view",
2740
- type: "function"
2741
- }
2742
- ];
2743
- var AuToken = {
2744
- abi: abi
2745
- };
2746
-
2747
1194
  var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
2748
1195
  _inheritsLoose(MoneyMarketRead, _BlockchainEntityRead);
2749
1196
 
@@ -2977,9 +1424,13 @@ var MoneyMarket = /*#__PURE__*/function (_BlockchainEntity) {
2977
1424
  return MoneyMarket;
2978
1425
  }(BlockchainEntity);
2979
1426
 
1427
+ function formatObject(object) {
1428
+ return JSON.stringify(object, null, ' ');
1429
+ }
1430
+
2980
1431
  function sum(a, b) {
2981
1432
  return a + b;
2982
1433
  }
2983
1434
 
2984
- export { AVAX_DEFAULT_PROVIDER, AVAX_DEFAULT_PROVIDER_URL, AVAX_DEFAULT_SIGNER, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, DOLLAR, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, SDK, SdkRead, SdkReadWrite, decimalFactor, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, formatObject, sum, validateAndParseAddress };
1435
+ export { AVAX_DEFAULT_PROVIDER, AVAX_DEFAULT_PROVIDER_URL, AVAX_DEFAULT_SIGNER, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, DOLLAR, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, SDK, SdkRead, SdkReadWrite, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, formatObject, sum };
2985
1436
  //# sourceMappingURL=sdk.esm.js.map