@aurigami/sdk 0.5.0 → 0.5.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/dist/SDK.d.ts CHANGED
@@ -28,6 +28,7 @@ export declare class SdkReadWrite extends SdkRead {
28
28
  claim(): Promise<TransactionResponse>;
29
29
  stake(amount: TokenAmount): Promise<TransactionResponse>;
30
30
  unstake(amount: TokenAmount): Promise<TransactionResponse>;
31
+ faucetDrip(): Promise<TransactionResponse>;
31
32
  }
32
33
  export declare class SDK extends BlockchainEntity {
33
34
  constructor();
@@ -2821,23 +2821,30 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
2821
2821
 
2822
2822
  _proto2.repay = /*#__PURE__*/function () {
2823
2823
  var _repay = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee15(amount) {
2824
+ var repayAmount;
2824
2825
  return runtime_1.wrap(function _callee15$(_context15) {
2825
2826
  while (1) {
2826
2827
  switch (_context15.prev = _context15.next) {
2827
2828
  case 0:
2829
+ if (new BigNumber(amount.rawAmount()).lt(0)) {
2830
+ repayAmount = INF;
2831
+ } else {
2832
+ repayAmount = ethers.BigNumber.from(amount.rawAmount());
2833
+ }
2834
+
2828
2835
  if (!isSameAddress(amount.token.address, ETHAddress)) {
2829
- _context15.next = 4;
2836
+ _context15.next = 5;
2830
2837
  break;
2831
2838
  }
2832
2839
 
2833
2840
  return _context15.abrupt("return", this.auToken.connect(this._networkConnection.signer).repayBorrow({
2834
- value: amount.rawAmount()
2841
+ value: repayAmount
2835
2842
  }));
2836
2843
 
2837
- case 4:
2838
- return _context15.abrupt("return", this.auToken.connect(this._networkConnection.signer).repayBorrow(amount.rawAmount()));
2839
-
2840
2844
  case 5:
2845
+ return _context15.abrupt("return", this.auToken.connect(this._networkConnection.signer).repayBorrow(repayAmount));
2846
+
2847
+ case 6:
2841
2848
  case "end":
2842
2849
  return _context15.stop();
2843
2850
  }
@@ -2921,6 +2928,12 @@ var MoneyMarket = /*#__PURE__*/function (_BlockchainEntity) {
2921
2928
  return MoneyMarket;
2922
2929
  }(BlockchainEntity);
2923
2930
 
2931
+ var abi$2 = [
2932
+ ];
2933
+ var FaucetABI = {
2934
+ abi: abi$2
2935
+ };
2936
+
2924
2937
  var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
2925
2938
  _inheritsLoose(SdkRead, _BlockchainEntityRead);
2926
2939
 
@@ -3352,6 +3365,31 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
3352
3365
  return unstake;
3353
3366
  }();
3354
3367
 
3368
+ _proto2.faucetDrip = /*#__PURE__*/function () {
3369
+ var _faucetDrip = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
3370
+ var faucet;
3371
+ return runtime_1.wrap(function _callee9$(_context9) {
3372
+ while (1) {
3373
+ switch (_context9.prev = _context9.next) {
3374
+ case 0:
3375
+ faucet = new ethers.Contract(networkAddresses.misc.FAUCET, FaucetABI.abi, this._networkConnection.provider);
3376
+ return _context9.abrupt("return", faucet.connect(this._networkConnection.signer).drip());
3377
+
3378
+ case 2:
3379
+ case "end":
3380
+ return _context9.stop();
3381
+ }
3382
+ }
3383
+ }, _callee9, this);
3384
+ }));
3385
+
3386
+ function faucetDrip() {
3387
+ return _faucetDrip.apply(this, arguments);
3388
+ }
3389
+
3390
+ return faucetDrip;
3391
+ }();
3392
+
3355
3393
  return SdkReadWrite;
3356
3394
  }(SdkRead);
3357
3395
  var SDK = /*#__PURE__*/function (_BlockchainEntity) {