@aurigami/sdk 1.14.0 → 1.15.1

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/ChangeLog.md CHANGED
@@ -1,4 +1,12 @@
1
1
  # Change Logs
2
+ # 1.15.0:
3
+ - `SDKRead(...).setUserNotificationSettings(address: string, mail: string, utilisation: number, liquidation: boolean, captchaResponse: string)`:
4
+ - utilisation in range (0..1)
5
+ - `SDKRead(...).unsetUserNotificationSettings(address: string, captchaResponse: string)` use this to unsubscribe for notification
6
+
7
+ # 1.14.0:
8
+ - Fix cache bug
9
+ - Remove `stNEAR` in `DEPOSIT_ONLY_TOKENS` (this is for monitoring bot)
2
10
  # 1.13.1
3
11
  - Add `PlyGameRead(...).overallLeaderboard(): Promise<PlyGameLeaderboardItem[]>`: overall ranking of the top 50 users by amount of PULP unlocked
4
12
 
package/dist/SDK.d.ts CHANGED
@@ -40,6 +40,8 @@ export declare class SdkRead extends BlockchainEntityRead {
40
40
  sneakAccounts(accounts: string[], tokenAddresses: string[], dust?: BigNumber): Promise<types.AccountAuTokensInfo[]>;
41
41
  getNetApyWithoutIncentive(userAddress: types.Address): Promise<BigNumber>;
42
42
  getNetApyWithIncentive(userAddress: types.Address): Promise<BigNumber>;
43
+ setUserNotificationSettings(address: types.Address, mail: string, utilisation: number, liquidation: boolean, captchaResponse: string): Promise<any>;
44
+ unsetUserNotificationSettings(address: types.Address, captchaResponse: string): Promise<any>;
43
45
  }
44
46
  export declare class SdkReadWrite extends SdkRead {
45
47
  /**
@@ -0,0 +1,2 @@
1
+ export declare function getApi(url: string, params?: Record<string, any>): Promise<any>;
2
+ export declare function postApi(url: string, body: Record<string, any>): Promise<any>;
@@ -5324,7 +5324,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5324
5324
  switch (_context4.prev = _context4.next) {
5325
5325
  case 0:
5326
5326
  _context4.next = 2;
5327
- return this.env.auriInternalLens.getAccountLiquidity(userAddr);
5327
+ return this.env.auriInternalLens.callStatic.getAccountLiquidityAccrueInterest(userAddr);
5328
5328
 
5329
5329
  case 2:
5330
5330
  accountDetail = _context4.sent;
@@ -6707,6 +6707,40 @@ var Referral = /*#__PURE__*/function (_BlockchainEntity) {
6707
6707
  return Referral;
6708
6708
  }(BlockchainEntity);
6709
6709
 
6710
+ var NOTIFICATION_API_END_POINT = 'https://api.aurigami.finance/notification/';
6711
+
6712
+ function postApi(_x3, _x4) {
6713
+ return _postApi.apply(this, arguments);
6714
+ }
6715
+
6716
+ function _postApi() {
6717
+ _postApi = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(url, body) {
6718
+ var resp;
6719
+ return runtime_1.wrap(function _callee2$(_context2) {
6720
+ while (1) {
6721
+ switch (_context2.prev = _context2.next) {
6722
+ case 0:
6723
+ _context2.next = 2;
6724
+ return axios.post(NOTIFICATION_API_END_POINT + url, body, {
6725
+ headers: {
6726
+ 'Content-Type': 'application/json'
6727
+ }
6728
+ });
6729
+
6730
+ case 2:
6731
+ resp = _context2.sent;
6732
+ return _context2.abrupt("return", resp.data);
6733
+
6734
+ case 4:
6735
+ case "end":
6736
+ return _context2.stop();
6737
+ }
6738
+ }
6739
+ }, _callee2);
6740
+ }));
6741
+ return _postApi.apply(this, arguments);
6742
+ }
6743
+
6710
6744
  var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
6711
6745
  _inheritsLoose(SdkRead, _BlockchainEntityRead);
6712
6746
 
@@ -7021,6 +7055,82 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
7021
7055
  return getNetApyWithIncentive;
7022
7056
  }();
7023
7057
 
7058
+ _proto.setUserNotificationSettings = /*#__PURE__*/function () {
7059
+ var _setUserNotificationSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(address, mail, utilisation, liquidation, captchaResponse) {
7060
+ var body, response;
7061
+ return runtime_1.wrap(function _callee12$(_context12) {
7062
+ while (1) {
7063
+ switch (_context12.prev = _context12.next) {
7064
+ case 0:
7065
+ body = {
7066
+ address: address,
7067
+ mail: mail,
7068
+ setting: {
7069
+ utilisation: utilisation,
7070
+ liquidation: liquidation
7071
+ },
7072
+ captchaResponse: captchaResponse
7073
+ };
7074
+ _context12.next = 3;
7075
+ return postApi('alert-setting/set', body);
7076
+
7077
+ case 3:
7078
+ response = _context12.sent;
7079
+ return _context12.abrupt("return", response);
7080
+
7081
+ case 5:
7082
+ case "end":
7083
+ return _context12.stop();
7084
+ }
7085
+ }
7086
+ }, _callee12);
7087
+ }));
7088
+
7089
+ function setUserNotificationSettings(_x12, _x13, _x14, _x15, _x16) {
7090
+ return _setUserNotificationSettings.apply(this, arguments);
7091
+ }
7092
+
7093
+ return setUserNotificationSettings;
7094
+ }();
7095
+
7096
+ _proto.unsetUserNotificationSettings = /*#__PURE__*/function () {
7097
+ var _unsetUserNotificationSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(address, captchaResponse) {
7098
+ var body, response;
7099
+ return runtime_1.wrap(function _callee13$(_context13) {
7100
+ while (1) {
7101
+ switch (_context13.prev = _context13.next) {
7102
+ case 0:
7103
+ body = {
7104
+ address: address,
7105
+ mail: '',
7106
+ setting: {
7107
+ utilisation: null,
7108
+ liquidation: false
7109
+ },
7110
+ captchaResponse: captchaResponse
7111
+ };
7112
+ _context13.next = 3;
7113
+ return postApi('alert-setting/set', body);
7114
+
7115
+ case 3:
7116
+ response = _context13.sent;
7117
+ return _context13.abrupt("return", response);
7118
+
7119
+ case 5:
7120
+ case "end":
7121
+ return _context13.stop();
7122
+ }
7123
+ }
7124
+ }, _callee13);
7125
+ }));
7126
+
7127
+ function unsetUserNotificationSettings(_x17, _x18) {
7128
+ return _unsetUserNotificationSettings.apply(this, arguments);
7129
+ }
7130
+
7131
+ return unsetUserNotificationSettings;
7132
+ }();
7133
+
7024
7134
  return SdkRead;
7025
7135
  }(BlockchainEntityRead);
7026
7136
  var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
@@ -7038,19 +7148,19 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
7038
7148
  _proto2.claim =
7039
7149
  /*#__PURE__*/
7040
7150
  function () {
7041
- var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12() {
7042
- return runtime_1.wrap(function _callee12$(_context12) {
7151
+ var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14() {
7152
+ return runtime_1.wrap(function _callee14$(_context14) {
7043
7153
  while (1) {
7044
- switch (_context12.prev = _context12.next) {
7154
+ switch (_context14.prev = _context14.next) {
7045
7155
  case 0:
7046
- return _context12.abrupt("return", this.env.auriLens.connect(this._networkConnection.signer).claimRewards(this.env.comptroller.address, this.env.auriFairLaunch.address, ALL_STAKING_POOLS));
7156
+ return _context14.abrupt("return", this.env.auriLens.connect(this._networkConnection.signer).claimRewards(this.env.comptroller.address, this.env.auriFairLaunch.address, ALL_STAKING_POOLS));
7047
7157
 
7048
7158
  case 1:
7049
7159
  case "end":
7050
- return _context12.stop();
7160
+ return _context14.stop();
7051
7161
  }
7052
7162
  }
7053
- }, _callee12, this);
7163
+ }, _callee14, this);
7054
7164
  }));
7055
7165
 
7056
7166
  function claim() {
@@ -7061,22 +7171,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
7061
7171
  }();
7062
7172
 
7063
7173
  _proto2.stake = /*#__PURE__*/function () {
7064
- var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(amount) {
7065
- return runtime_1.wrap(function _callee13$(_context13) {
7174
+ var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee15(amount) {
7175
+ return runtime_1.wrap(function _callee15$(_context15) {
7066
7176
  while (1) {
7067
- switch (_context13.prev = _context13.next) {
7177
+ switch (_context15.prev = _context15.next) {
7068
7178
  case 0:
7069
- return _context13.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
7179
+ return _context15.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
7070
7180
 
7071
7181
  case 1:
7072
7182
  case "end":
7073
- return _context13.stop();
7183
+ return _context15.stop();
7074
7184
  }
7075
7185
  }
7076
- }, _callee13, this);
7186
+ }, _callee15, this);
7077
7187
  }));
7078
7188
 
7079
- function stake(_x12) {
7189
+ function stake(_x19) {
7080
7190
  return _stake.apply(this, arguments);
7081
7191
  }
7082
7192
 
@@ -7084,22 +7194,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
7084
7194
  }();
7085
7195
 
7086
7196
  _proto2.unstake = /*#__PURE__*/function () {
7087
- var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14(amount) {
7088
- return runtime_1.wrap(function _callee14$(_context14) {
7197
+ var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee16(amount) {
7198
+ return runtime_1.wrap(function _callee16$(_context16) {
7089
7199
  while (1) {
7090
- switch (_context14.prev = _context14.next) {
7200
+ switch (_context16.prev = _context16.next) {
7091
7201
  case 0:
7092
- return _context14.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
7202
+ return _context16.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
7093
7203
 
7094
7204
  case 1:
7095
7205
  case "end":
7096
- return _context14.stop();
7206
+ return _context16.stop();
7097
7207
  }
7098
7208
  }
7099
- }, _callee14, this);
7209
+ }, _callee16, this);
7100
7210
  }));
7101
7211
 
7102
- function unstake(_x13) {
7212
+ function unstake(_x20) {
7103
7213
  return _unstake.apply(this, arguments);
7104
7214
  }
7105
7215