@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.
- package/dist/constants.d.ts +1 -0
- package/dist/sdk.cjs.development.js +74 -36
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +74 -36
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/MoneyMarket.ts +5 -1
- package/src/SDK.ts +1 -1
- package/src/constants.ts +23 -15
- package/src/decimals.ts +12 -12
- package/src/deployments/aurora_mainnet.json +18 -28
- package/src/priceFetcher.ts +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -919,38 +919,45 @@ var AURORA_CHAINID = 1313161554;
|
|
|
919
919
|
var DECIMAL_PRECISION = 10;
|
|
920
920
|
var networkAddresses = {
|
|
921
921
|
auTokens: [{
|
|
922
|
-
|
|
922
|
+
name: "auUSDC",
|
|
923
|
+
address: /*#__PURE__*/'0x9728d8920707a5C12958E4cB2979Ae5588F85EcA'.toLowerCase(),
|
|
923
924
|
underlying: /*#__PURE__*/'0xb12bfca5a55806aaf64e99521918a4bf0fc40802'.toLowerCase()
|
|
924
925
|
}, {
|
|
925
|
-
|
|
926
|
+
name: "auETH",
|
|
927
|
+
address: /*#__PURE__*/'0xc263e92038139879918C0DE0e97eA2F3f3984F72'.toLowerCase(),
|
|
926
928
|
underlying: /*#__PURE__*/ETHAddress.toLowerCase()
|
|
927
929
|
}, {
|
|
928
|
-
|
|
930
|
+
name: "auWBTC",
|
|
931
|
+
address: /*#__PURE__*/'0xC08FF86edF64c2d3816Eb43c5Ec95475a2d47BD0'.toLowerCase(),
|
|
929
932
|
underlying: /*#__PURE__*/'0xf4eb217ba2454613b15dbdea6e5f22276410e89e'.toLowerCase()
|
|
930
933
|
}, {
|
|
931
|
-
|
|
934
|
+
name: "auUSDT",
|
|
935
|
+
address: /*#__PURE__*/'0x22AE568df8D8AeE3Ed9Ab0f135Ca8cFeF5d2Cf18'.toLowerCase(),
|
|
932
936
|
underlying: /*#__PURE__*/'0x4988a896b1227218e4a686fde5eabdcabd91571f'.toLowerCase()
|
|
933
937
|
}, {
|
|
934
|
-
|
|
938
|
+
name: "auDAI",
|
|
939
|
+
address: /*#__PURE__*/'0x6664d272c820d70c923DE9b1992De02A12C8a7d8'.toLowerCase(),
|
|
935
940
|
underlying: /*#__PURE__*/'0xe3520349f477a5f6eb06107066048508498a291b'.toLowerCase()
|
|
936
941
|
}, {
|
|
937
|
-
|
|
938
|
-
|
|
942
|
+
name: "auPLY",
|
|
943
|
+
address: /*#__PURE__*/'0xD204fD43bFe4aAEB9aB993c116c1dECdDF1b9F1A'.toLowerCase(),
|
|
944
|
+
underlying: /*#__PURE__*/'0x9ae13dd1FFd2008F68bC71d93C5a2381dC3F1D27'.toLowerCase()
|
|
939
945
|
}, {
|
|
940
|
-
|
|
946
|
+
name: "auWNEAR",
|
|
947
|
+
address: /*#__PURE__*/'0xa64F1875080B91Db293dE1f547DC1D6Bc5d3Ef55'.toLowerCase(),
|
|
941
948
|
underlying: /*#__PURE__*/'0xC42C30aC6Cc15faC9bD938618BcaA1a1FaE8501d'.toLowerCase()
|
|
942
949
|
}],
|
|
943
950
|
misc: {
|
|
944
|
-
COMPTROLLER: /*#__PURE__*/"
|
|
945
|
-
oracle: /*#__PURE__*/"
|
|
946
|
-
AURIFAIRLAUNCH: /*#__PURE__*/"
|
|
947
|
-
AURILENS: /*#__PURE__*/'
|
|
948
|
-
TOKENLOCK: /*#__PURE__*/'
|
|
949
|
-
FAUCET: /*#__PURE__*/
|
|
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__*/"
|
|
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
|
-
'
|
|
970
|
-
'0xe3520349f477a5f6eb06107066048508498a291b': 18,
|
|
971
|
-
'0xf9739783b767b358b21a1373140296c09271d6f5': 8,
|
|
972
|
-
'0x07a4f270836f2b2b5cacb00b09552e690276ac33': 18,
|
|
974
|
+
'0xd204fd43bfe4aaeb9ab993c116c1decddf1b9f1a': 8,
|
|
973
975
|
'0xf4eb217ba2454613b15dbdea6e5f22276410e89e': 8,
|
|
974
|
-
'
|
|
975
|
-
'
|
|
976
|
-
'
|
|
977
|
-
'
|
|
978
|
-
'
|
|
979
|
-
'
|
|
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.
|
|
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
|
-
|
|
2850
|
-
|
|
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 =
|
|
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
|
|
2901
|
+
case 21:
|
|
2864
2902
|
return _context15.abrupt("return", this.auToken.connect(this._networkConnection.signer).repayBorrow(repayAmount));
|
|
2865
2903
|
|
|
2866
|
-
case
|
|
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()
|
|
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":
|