@aurigami/sdk 1.11.1 → 1.11.2-dummy1

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
@@ -1787,21 +1787,23 @@ var dummyUserMarketDetails = {
1787
1787
  };
1788
1788
  var referralRewardDummy1 = {
1789
1789
  campaign: 'testa',
1790
- startTime: 1652882400,
1791
- endTime: 1653573599,
1790
+ startTime: /*#__PURE__*/Math.trunc( /*#__PURE__*/new Date(2022, 8, 1).getTime() / 1000),
1791
+ endTime: /*#__PURE__*/Math.trunc( /*#__PURE__*/new Date(2022, 9, 30).getTime() / 1000),
1792
1792
  isReferrer: false,
1793
1793
  rewardTokenAmount: dummyTokenAmount,
1794
1794
  transactionHash: null,
1795
- userAddr: '0x...123'
1795
+ userAddr: '0x...123',
1796
+ refereeAddress: '0x123..123'
1796
1797
  };
1797
1798
  var referralRewardDummy2 = {
1798
1799
  campaign: 'testb',
1799
- startTime: 1652882400,
1800
- endTime: 1653573599,
1800
+ startTime: /*#__PURE__*/Math.trunc( /*#__PURE__*/new Date(2022, 8, 1).getTime() / 1000),
1801
+ endTime: /*#__PURE__*/Math.trunc( /*#__PURE__*/new Date(2022, 8, 31).getTime() / 1000),
1801
1802
  isReferrer: true,
1802
1803
  rewardTokenAmount: dummyTokenAmount2,
1803
1804
  transactionHash: '0x4da9657663b46ef18d150b897b28c7b717f16421978b52e3a06d91b54ca3548b',
1804
- userAddr: '0x...456'
1805
+ userAddr: '0x...456',
1806
+ refereeAddress: '0x123..123'
1805
1807
  };
1806
1808
 
1807
1809
  var AURIGAMI_API_END_POINT = 'https://api.aurigami.finance/app/';
@@ -5275,12 +5277,14 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5275
5277
  rewardTokenAmount: TokenAmount.fromAddressAndAmount(item.token, item.amount),
5276
5278
  startTime: REFERRAL_CAMPAIGNS[item.campaign].start,
5277
5279
  endTime: REFERRAL_CAMPAIGNS[item.campaign].end,
5278
- transactionHash: (_item$transactionHash = item.transactionHash) != null ? _item$transactionHash : null
5280
+ transactionHash: (_item$transactionHash = item.transactionHash) != null ? _item$transactionHash : null,
5281
+ refereeAddress: null
5279
5282
  };
5280
5283
  });
5284
+ items = [referralRewardDummy1, referralRewardDummy2].concat(items);
5281
5285
  return _context5.abrupt("return", items);
5282
5286
 
5283
- case 5:
5287
+ case 6:
5284
5288
  case "end":
5285
5289
  return _context5.stop();
5286
5290
  }
@@ -5323,7 +5327,8 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5323
5327
  rewardTokenAmount: TokenAmount.fromAddressAndAmount(item.token, item.amount),
5324
5328
  startTime: REFERRAL_CAMPAIGNS[item.campaign].start,
5325
5329
  endTime: REFERRAL_CAMPAIGNS[item.campaign].end,
5326
- transactionHash: null
5330
+ transactionHash: null,
5331
+ refereeAddress: null
5327
5332
  };
5328
5333
  });
5329
5334
  items.sort(function (a, b) {
@@ -5344,6 +5349,84 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5344
5349
  }
5345
5350
 
5346
5351
  return leaderboard;
5352
+ }()
5353
+ /**
5354
+ * current number of slots under a referral code being used that exceed minimum deposit amount
5355
+ */
5356
+ ;
5357
+
5358
+ _proto.slotsInUse =
5359
+ /*#__PURE__*/
5360
+ function () {
5361
+ var _slotsInUse = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(referralCode) {
5362
+ return runtime_1.wrap(function _callee7$(_context7) {
5363
+ while (1) {
5364
+ switch (_context7.prev = _context7.next) {
5365
+ case 0:
5366
+ return _context7.abrupt("return", 123);
5367
+
5368
+ case 1:
5369
+ case "end":
5370
+ return _context7.stop();
5371
+ }
5372
+ }
5373
+ }, _callee7);
5374
+ }));
5375
+
5376
+ function slotsInUse(_x7) {
5377
+ return _slotsInUse.apply(this, arguments);
5378
+ }
5379
+
5380
+ return slotsInUse;
5381
+ }();
5382
+
5383
+ _proto.totalReferralSlots = function totalReferralSlots() {
5384
+ return 500;
5385
+ }
5386
+ /**
5387
+ * a way to determine qualification status of a user. null if not referred yet,
5388
+ * qualified if referred + min deposit, notQualified if referred + min deposit
5389
+ * not reached or withdrew too early
5390
+ */
5391
+ ;
5392
+
5393
+ _proto.userReferralStatus =
5394
+ /*#__PURE__*/
5395
+ function () {
5396
+ var _userReferralStatus = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(userAddr) {
5397
+ return runtime_1.wrap(function _callee8$(_context8) {
5398
+ while (1) {
5399
+ switch (_context8.prev = _context8.next) {
5400
+ case 0:
5401
+ _context8.next = 2;
5402
+ return this.getReferralCodeUsed(userAddr);
5403
+
5404
+ case 2:
5405
+ _context8.t0 = _context8.sent;
5406
+
5407
+ if (!(_context8.t0 !== '')) {
5408
+ _context8.next = 7;
5409
+ break;
5410
+ }
5411
+
5412
+ return _context8.abrupt("return", 'notQualified');
5413
+
5414
+ case 7:
5415
+ return _context8.abrupt("return", 'notReferred');
5416
+
5417
+ case 8:
5418
+ case "end":
5419
+ return _context8.stop();
5420
+ }
5421
+ }
5422
+ }, _callee8, this);
5423
+ }));
5424
+
5425
+ function userReferralStatus(_x8) {
5426
+ return _userReferralStatus.apply(this, arguments);
5427
+ }
5428
+
5429
+ return userReferralStatus;
5347
5430
  }();
5348
5431
 
5349
5432
  return ReferralRead;
@@ -5365,21 +5448,21 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5365
5448
  _proto2.registerNewReferralCode =
5366
5449
  /*#__PURE__*/
5367
5450
  function () {
5368
- var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
5451
+ var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
5369
5452
  var referralCode;
5370
- return runtime_1.wrap(function _callee7$(_context7) {
5453
+ return runtime_1.wrap(function _callee9$(_context9) {
5371
5454
  while (1) {
5372
- switch (_context7.prev = _context7.next) {
5455
+ switch (_context9.prev = _context9.next) {
5373
5456
  case 0:
5374
5457
  referralCode = ethers.utils.formatBytes32String(this.generateReferralCode());
5375
- return _context7.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerNewUserReferralCode(referralCode));
5458
+ return _context9.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerNewUserReferralCode(referralCode));
5376
5459
 
5377
5460
  case 2:
5378
5461
  case "end":
5379
- return _context7.stop();
5462
+ return _context9.stop();
5380
5463
  }
5381
5464
  }
5382
- }, _callee7, this);
5465
+ }, _callee9, this);
5383
5466
  }));
5384
5467
 
5385
5468
  function registerNewReferralCode() {
@@ -5396,24 +5479,24 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5396
5479
  _proto2.useReferralCode =
5397
5480
  /*#__PURE__*/
5398
5481
  function () {
5399
- var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(code) {
5482
+ var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(code) {
5400
5483
  var referralCode;
5401
- return runtime_1.wrap(function _callee8$(_context8) {
5484
+ return runtime_1.wrap(function _callee10$(_context10) {
5402
5485
  while (1) {
5403
- switch (_context8.prev = _context8.next) {
5486
+ switch (_context10.prev = _context10.next) {
5404
5487
  case 0:
5405
5488
  referralCode = ethers.utils.formatBytes32String(code);
5406
- return _context8.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerReferralCodeUsed(referralCode));
5489
+ return _context10.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerReferralCodeUsed(referralCode));
5407
5490
 
5408
5491
  case 2:
5409
5492
  case "end":
5410
- return _context8.stop();
5493
+ return _context10.stop();
5411
5494
  }
5412
5495
  }
5413
- }, _callee8, this);
5496
+ }, _callee10, this);
5414
5497
  }));
5415
5498
 
5416
- function useReferralCode(_x7) {
5499
+ function useReferralCode(_x9) {
5417
5500
  return _useReferralCode.apply(this, arguments);
5418
5501
  }
5419
5502
 
@@ -5427,23 +5510,23 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5427
5510
  _proto2.claimReferralRewards =
5428
5511
  /*#__PURE__*/
5429
5512
  function () {
5430
- var _claimReferralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
5513
+ var _claimReferralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
5431
5514
  var unclaimedRewards, campaigns, tokens;
5432
- return runtime_1.wrap(function _callee9$(_context9) {
5515
+ return runtime_1.wrap(function _callee11$(_context11) {
5433
5516
  while (1) {
5434
- switch (_context9.prev = _context9.next) {
5517
+ switch (_context11.prev = _context11.next) {
5435
5518
  case 0:
5436
- _context9.t0 = this;
5437
- _context9.next = 3;
5519
+ _context11.t0 = this;
5520
+ _context11.next = 3;
5438
5521
  return this._networkConnection.signer.getAddress();
5439
5522
 
5440
5523
  case 3:
5441
- _context9.t1 = _context9.sent;
5442
- _context9.next = 6;
5443
- return _context9.t0.referralRewards.call(_context9.t0, _context9.t1);
5524
+ _context11.t1 = _context11.sent;
5525
+ _context11.next = 6;
5526
+ return _context11.t0.referralRewards.call(_context11.t0, _context11.t1);
5444
5527
 
5445
5528
  case 6:
5446
- unclaimedRewards = _context9.sent.filter(function (reward) {
5529
+ unclaimedRewards = _context11.sent.filter(function (reward) {
5447
5530
  return reward.transactionHash == null;
5448
5531
  });
5449
5532
  campaigns = unclaimedRewards.map(function (reward) {
@@ -5452,14 +5535,14 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5452
5535
  tokens = unclaimedRewards.map(function (reward) {
5453
5536
  return reward.rewardTokenAmount.token.address;
5454
5537
  });
5455
- return _context9.abrupt("return", new AirdropReadWrite(this._networkConnection).redeemMultiple(campaigns, tokens));
5538
+ return _context11.abrupt("return", new AirdropReadWrite(this._networkConnection).redeemMultiple(campaigns, tokens));
5456
5539
 
5457
5540
  case 10:
5458
5541
  case "end":
5459
- return _context9.stop();
5542
+ return _context11.stop();
5460
5543
  }
5461
5544
  }
5462
- }, _callee9, this);
5545
+ }, _callee11, this);
5463
5546
  }));
5464
5547
 
5465
5548
  function claimReferralRewards() {