@aurigami/sdk 0.7.2 → 0.8.0

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.
@@ -6,6 +6,7 @@ export declare const AURORA_CHAINID = 1313161554;
6
6
  export declare const DECIMAL_PRECISION = 10;
7
7
  export declare type NetworkAddresses = {
8
8
  auTokens: {
9
+ name: string;
9
10
  address: string;
10
11
  underlying: string;
11
12
  }[];
@@ -919,38 +919,45 @@ var AURORA_CHAINID = 1313161554;
919
919
  var DECIMAL_PRECISION = 10;
920
920
  var networkAddresses = {
921
921
  auTokens: [{
922
- address: /*#__PURE__*/'0x7D9F7B4734E274Ff10531bBD5aE8fE6069164d28'.toLowerCase(),
922
+ name: "auUSDC",
923
+ address: /*#__PURE__*/'0x9728d8920707a5C12958E4cB2979Ae5588F85EcA'.toLowerCase(),
923
924
  underlying: /*#__PURE__*/'0xb12bfca5a55806aaf64e99521918a4bf0fc40802'.toLowerCase()
924
925
  }, {
925
- address: /*#__PURE__*/'0x580Ac375176A4e9B26977490656c3B2F00Abf624'.toLowerCase(),
926
+ name: "auETH",
927
+ address: /*#__PURE__*/'0xc263e92038139879918C0DE0e97eA2F3f3984F72'.toLowerCase(),
926
928
  underlying: /*#__PURE__*/ETHAddress.toLowerCase()
927
929
  }, {
928
- address: /*#__PURE__*/'0x705b9d83222c4EeDeaD1A0E399cDeB917173E1F6'.toLowerCase(),
930
+ name: "auWBTC",
931
+ address: /*#__PURE__*/'0xC08FF86edF64c2d3816Eb43c5Ec95475a2d47BD0'.toLowerCase(),
929
932
  underlying: /*#__PURE__*/'0xf4eb217ba2454613b15dbdea6e5f22276410e89e'.toLowerCase()
930
933
  }, {
931
- address: /*#__PURE__*/'0xF9739783b767b358b21A1373140296c09271d6F5'.toLowerCase(),
934
+ name: "auUSDT",
935
+ address: /*#__PURE__*/'0x22AE568df8D8AeE3Ed9Ab0f135Ca8cFeF5d2Cf18'.toLowerCase(),
932
936
  underlying: /*#__PURE__*/'0x4988a896b1227218e4a686fde5eabdcabd91571f'.toLowerCase()
933
937
  }, {
934
- address: /*#__PURE__*/'0x4d2c286D74597B13642dd311D1050dFf9E7eF666'.toLowerCase(),
938
+ name: "auDAI",
939
+ address: /*#__PURE__*/'0x6664d272c820d70c923DE9b1992De02A12C8a7d8'.toLowerCase(),
935
940
  underlying: /*#__PURE__*/'0xe3520349f477a5f6eb06107066048508498a291b'.toLowerCase()
936
941
  }, {
937
- address: /*#__PURE__*/'0x367E3fD10006bC64D279e5F1F499DcfA92518A35'.toLowerCase(),
938
- underlying: /*#__PURE__*/'0x07a4f270836F2B2B5CACb00b09552e690276aC33'.toLowerCase()
942
+ name: "auPLY",
943
+ address: /*#__PURE__*/'0xD204fD43bFe4aAEB9aB993c116c1dECdDF1b9F1A'.toLowerCase(),
944
+ underlying: /*#__PURE__*/'0x9ae13dd1FFd2008F68bC71d93C5a2381dC3F1D27'.toLowerCase()
939
945
  }, {
940
- address: /*#__PURE__*/'0x7FDe6C1C53DD4E94a8CD4c60BF1418613c90c42F'.toLowerCase(),
946
+ name: "auWNEAR",
947
+ address: /*#__PURE__*/'0xa64F1875080B91Db293dE1f547DC1D6Bc5d3Ef55'.toLowerCase(),
941
948
  underlying: /*#__PURE__*/'0xC42C30aC6Cc15faC9bD938618BcaA1a1FaE8501d'.toLowerCase()
942
949
  }],
943
950
  misc: {
944
- COMPTROLLER: /*#__PURE__*/"0xc77877b0bd08fE3B060EbD8AEE06fb560C91A125".toLowerCase(),
945
- oracle: /*#__PURE__*/"0x9c8180255ED1bA5fA812FABc933E3ecbd3B585D5".toLowerCase(),
946
- AURIFAIRLAUNCH: /*#__PURE__*/"0x660159696c9E0B2c17E3e0ac2019F436aE34fc7A".toLowerCase(),
947
- AURILENS: /*#__PURE__*/'0x503bD4B6a056F7E66671D2B4620f0aDC4ff2A4e9'.toLowerCase(),
948
- TOKENLOCK: /*#__PURE__*/'0xa4623FC7C96B59f9a0a46144324d68C8E8710966'.toLowerCase(),
949
- FAUCET: /*#__PURE__*/'0x8F791d611D71699B76C03857A51D7B7E5E66f01E'.toLowerCase()
951
+ COMPTROLLER: /*#__PURE__*/"0xe3618BaDA3728a339A2214423C0426AD47d30626".toLowerCase(),
952
+ oracle: /*#__PURE__*/"0xC6e5185438e1730959c1eF3551059A3feC744E90".toLowerCase(),
953
+ AURIFAIRLAUNCH: /*#__PURE__*/"0x451d4e8964d79081EFFDAEde236354b20b678640".toLowerCase(),
954
+ AURILENS: /*#__PURE__*/'0xe8b53eE0443620fB8DcEaEB6DE98ED117971c329'.toLowerCase(),
955
+ TOKENLOCK: /*#__PURE__*/'0xE28339435478245CB1c57f84D246b67EECb3E204'.toLowerCase(),
956
+ FAUCET: /*#__PURE__*/dummyAddress.toLowerCase()
950
957
  },
951
958
  tokens: {
952
959
  AURORA: /*#__PURE__*/"0x8bec47865ade3b172a928df8f990bc7f2a3b9f79".toLowerCase(),
953
- PLY: /*#__PURE__*/"0x07a4f270836F2B2B5CACb00b09552e690276aC33".toLowerCase(),
960
+ PLY: /*#__PURE__*/"0x9ae13dd1FFd2008F68bC71d93C5a2381dC3F1D27".toLowerCase(),
954
961
  AURPLY: /*#__PURE__*/dummyAddress.toLowerCase()
955
962
  }
956
963
  };
@@ -963,20 +970,20 @@ var INF = /*#__PURE__*/ethers.BigNumber.from(2).pow(256).sub(1);
963
970
 
964
971
  var decimalRecords = {
965
972
  '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee': 18,
966
- '0x8bec47865ade3b172a928df8f990bc7f2a3b9f79': 18,
967
- '0x4988a896b1227218e4a686fde5eabdcabd91571f': 6,
968
973
  '0xb12bfca5a55806aaf64e99521918a4bf0fc40802': 6,
969
- '0x7fde6c1c53dd4e94a8cd4c60bf1418613c90c42f': 8,
970
- '0xe3520349f477a5f6eb06107066048508498a291b': 18,
971
- '0xf9739783b767b358b21a1373140296c09271d6f5': 8,
972
- '0x07a4f270836f2b2b5cacb00b09552e690276ac33': 18,
974
+ '0xd204fd43bfe4aaeb9ab993c116c1decddf1b9f1a': 8,
973
975
  '0xf4eb217ba2454613b15dbdea6e5f22276410e89e': 8,
974
- '0x705b9d83222c4eedead1a0e399cdeb917173e1f6': 8,
975
- '0x367e3fd10006bc64d279e5f1f499dcfa92518a35': 8,
976
- '0x580ac375176a4e9b26977490656c3b2f00abf624': 8,
977
- '0x4d2c286d74597b13642dd311d1050dff9e7ef666': 8,
978
- '0x7d9f7b4734e274ff10531bbd5ae8fe6069164d28': 8,
979
- '0xc42c30ac6cc15fac9bd938618bcaa1a1fae8501d': 24
976
+ '0xc08ff86edf64c2d3816eb43c5ec95475a2d47bd0': 8,
977
+ '0xc263e92038139879918c0de0e97ea2f3f3984f72': 8,
978
+ '0x22ae568df8d8aee3ed9ab0f135ca8cfef5d2cf18': 8,
979
+ '0x9ae13dd1ffd2008f68bc71d93c5a2381dc3f1d27': 18,
980
+ '0x9728d8920707a5c12958e4cb2979ae5588f85eca': 8,
981
+ '0xa64f1875080b91db293de1f547dc1d6bc5d3ef55': 8,
982
+ '0xe3520349f477a5f6eb06107066048508498a291b': 18,
983
+ '0x4988a896b1227218e4a686fde5eabdcabd91571f': 6,
984
+ '0xc42c30ac6cc15fac9bd938618bcaa1a1fae8501d': 24,
985
+ '0x8bec47865ade3b172a928df8f990bc7f2a3b9f79': 18,
986
+ '0x6664d272c820d70c923de9b1992de02a12c8a7d8': 8
980
987
  };
981
988
 
982
989
  function formatObject(object) {
@@ -2267,7 +2274,7 @@ function _fetchPrice() {
2267
2274
  return _context7.abrupt("return", fetchPriceFromOracle(matchingAuToken.address, getDecimal(address), provider));
2268
2275
 
2269
2276
  case 7:
2270
- if (!isSameAddress(address, networkAddresses.misc.AUPLYLP)) {
2277
+ if (!isSameAddress(address, networkAddresses.tokens.AUPLYLP)) {
2271
2278
  _context7.next = 11;
2272
2279
  break;
2273
2280
  }
@@ -2845,14 +2852,45 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
2845
2852
  while (1) {
2846
2853
  switch (_context15.prev = _context15.next) {
2847
2854
  case 0:
2848
- if (new BigNumber(amount.rawAmount()).lt(0)) {
2849
- repayAmount = INF;
2850
- } else {
2851
- repayAmount = ethers.BigNumber.from(amount.rawAmount());
2855
+ if (!new BigNumber(amount.rawAmount()).lt(0)) {
2856
+ _context15.next = 16;
2857
+ break;
2852
2858
  }
2853
2859
 
2854
2860
  if (!isSameAddress(amount.token.address, ETHAddress)) {
2855
- _context15.next = 5;
2861
+ _context15.next = 13;
2862
+ break;
2863
+ }
2864
+
2865
+ _context15.t0 = ethers.BigNumber;
2866
+ _context15.t1 = this;
2867
+ _context15.next = 6;
2868
+ return this._networkConnection.signer.getAddress();
2869
+
2870
+ case 6:
2871
+ _context15.t2 = _context15.sent;
2872
+ _context15.next = 9;
2873
+ return _context15.t1.getUserBorrowBalance.call(_context15.t1, _context15.t2);
2874
+
2875
+ case 9:
2876
+ _context15.t3 = _context15.sent.rawAmount();
2877
+ repayAmount = _context15.t0.from.call(_context15.t0, _context15.t3);
2878
+ _context15.next = 14;
2879
+ break;
2880
+
2881
+ case 13:
2882
+ repayAmount = INF;
2883
+
2884
+ case 14:
2885
+ _context15.next = 17;
2886
+ break;
2887
+
2888
+ case 16:
2889
+ repayAmount = ethers.BigNumber.from(amount.rawAmount());
2890
+
2891
+ case 17:
2892
+ if (!isSameAddress(amount.token.address, ETHAddress)) {
2893
+ _context15.next = 21;
2856
2894
  break;
2857
2895
  }
2858
2896
 
@@ -2860,10 +2898,10 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
2860
2898
  value: repayAmount
2861
2899
  }));
2862
2900
 
2863
- case 5:
2901
+ case 21:
2864
2902
  return _context15.abrupt("return", this.auToken.connect(this._networkConnection.signer).repayBorrow(repayAmount));
2865
2903
 
2866
- case 6:
2904
+ case 22:
2867
2905
  case "end":
2868
2906
  return _context15.stop();
2869
2907
  }
@@ -3345,7 +3383,7 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
3345
3383
  while (1) {
3346
3384
  switch (_context7.prev = _context7.next) {
3347
3385
  case 0:
3348
- return _context7.abrupt("return", this._auriFairLaunch.connect(this._networkConnection.signer).deposit(AurPlyPid, amount.rawAmount(), false));
3386
+ return _context7.abrupt("return", this._auriFairLaunch.connect(this._networkConnection.signer).deposit(AurPlyPid, amount.rawAmount()));
3349
3387
 
3350
3388
  case 1:
3351
3389
  case "end":