@aurigami/sdk 1.11.0 → 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.
@@ -8,6 +8,7 @@ export declare function formatObject(object: Object): string;
8
8
  export declare function decimalFactor(decimal: number): string;
9
9
  export declare const isSameAddress: (address1: Address, address2: Address) => boolean;
10
10
  export declare const getCurrentTimestamp: () => number;
11
+ export declare function sleep(duration: number): Promise<void>;
11
12
  export declare function validateAndParseAddress(address: Address): Address;
12
13
  export declare function getDecimal(address: Address): number;
13
14
  export declare function getSymbol(address: Address): string;
@@ -38,6 +38,17 @@ export declare class ReferralRead extends BlockchainEntityRead {
38
38
  * Top 50 reward earners from the last round, sorted by token amount
39
39
  */
40
40
  leaderboard(campaign: string): Promise<ReferralReward[]>;
41
+ /**
42
+ * current number of slots under a referral code being used that exceed minimum deposit amount
43
+ */
44
+ slotsInUse(referralCode: string): Promise<number>;
45
+ totalReferralSlots(): number;
46
+ /**
47
+ * a way to determine qualification status of a user. null if not referred yet,
48
+ * qualified if referred + min deposit, notQualified if referred + min deposit
49
+ * not reached or withdrew too early
50
+ */
51
+ userReferralStatus(userAddr: Address): Promise<string>;
41
52
  }
42
53
  export declare class ReferralReadWrite extends ReferralRead {
43
54
  /**
@@ -1212,6 +1212,30 @@ var isSameAddress = function isSameAddress(address1, address2) {
1212
1212
  var getCurrentTimestamp = function getCurrentTimestamp() {
1213
1213
  return Math.trunc(Date.now() / 1000);
1214
1214
  };
1215
+ function sleep(_x) {
1216
+ return _sleep.apply(this, arguments);
1217
+ }
1218
+
1219
+ function _sleep() {
1220
+ _sleep = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(duration) {
1221
+ return runtime_1.wrap(function _callee$(_context) {
1222
+ while (1) {
1223
+ switch (_context.prev = _context.next) {
1224
+ case 0:
1225
+ return _context.abrupt("return", new Promise(function (resolve) {
1226
+ setTimeout(resolve, duration);
1227
+ }));
1228
+
1229
+ case 1:
1230
+ case "end":
1231
+ return _context.stop();
1232
+ }
1233
+ }
1234
+ }, _callee);
1235
+ }));
1236
+ return _sleep.apply(this, arguments);
1237
+ }
1238
+
1215
1239
  function validateAndParseAddress(address) {
1216
1240
  try {
1217
1241
  return ethers.utils.getAddress(address);
@@ -1253,35 +1277,35 @@ function calcLMRewardApr(rewardsValue, totalStakeValue, frequencyPerYear) {
1253
1277
 
1254
1278
  return rewardsValue.multipliedBy(frequencyPerYear).dividedBy(totalStakeValue);
1255
1279
  }
1256
- function getBlockTimestamp(_x, _x2) {
1280
+ function getBlockTimestamp(_x2, _x3) {
1257
1281
  return _getBlockTimestamp.apply(this, arguments);
1258
1282
  }
1259
1283
 
1260
1284
  function _getBlockTimestamp() {
1261
- _getBlockTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(provider, blockNumber) {
1285
+ _getBlockTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(provider, blockNumber) {
1262
1286
  var block;
1263
- return runtime_1.wrap(function _callee$(_context) {
1287
+ return runtime_1.wrap(function _callee2$(_context2) {
1264
1288
  while (1) {
1265
- switch (_context.prev = _context.next) {
1289
+ switch (_context2.prev = _context2.next) {
1266
1290
  case 0:
1267
- _context.next = 2;
1291
+ _context2.next = 2;
1268
1292
  return provider.getBlock(blockNumber);
1269
1293
 
1270
1294
  case 2:
1271
- block = _context.sent;
1272
- return _context.abrupt("return", block.timestamp);
1295
+ block = _context2.sent;
1296
+ return _context2.abrupt("return", block.timestamp);
1273
1297
 
1274
1298
  case 4:
1275
1299
  case "end":
1276
- return _context.stop();
1300
+ return _context2.stop();
1277
1301
  }
1278
1302
  }
1279
- }, _callee);
1303
+ }, _callee2);
1280
1304
  }));
1281
1305
  return _getBlockTimestamp.apply(this, arguments);
1282
1306
  }
1283
1307
 
1284
- function getBlocksTimestampViaRPC(_x3, _x4) {
1308
+ function getBlocksTimestampViaRPC(_x4, _x5) {
1285
1309
  return _getBlocksTimestampViaRPC.apply(this, arguments);
1286
1310
  }
1287
1311
  /**
@@ -1291,11 +1315,11 @@ function getBlocksTimestampViaRPC(_x3, _x4) {
1291
1315
  */
1292
1316
 
1293
1317
  function _getBlocksTimestampViaRPC() {
1294
- _getBlocksTimestampViaRPC = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(provider, blocksNumber) {
1318
+ _getBlocksTimestampViaRPC = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(provider, blocksNumber) {
1295
1319
  var CHUNK_SIZE, results, i, slice, promises;
1296
- return runtime_1.wrap(function _callee3$(_context3) {
1320
+ return runtime_1.wrap(function _callee4$(_context4) {
1297
1321
  while (1) {
1298
- switch (_context3.prev = _context3.next) {
1322
+ switch (_context4.prev = _context4.next) {
1299
1323
  case 0:
1300
1324
  // Promise all 200 blocks at a time, using too many blocks at once will cause the RPC call timeout.
1301
1325
  CHUNK_SIZE = 200;
@@ -1304,58 +1328,58 @@ function _getBlocksTimestampViaRPC() {
1304
1328
 
1305
1329
  case 3:
1306
1330
  if (!(i < blocksNumber.length)) {
1307
- _context3.next = 14;
1331
+ _context4.next = 14;
1308
1332
  break;
1309
1333
  }
1310
1334
 
1311
1335
  slice = blocksNumber.slice(i, i + CHUNK_SIZE);
1312
1336
  promises = slice.map( /*#__PURE__*/function () {
1313
- var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(blockNumber) {
1314
- return runtime_1.wrap(function _callee2$(_context2) {
1337
+ var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(blockNumber) {
1338
+ return runtime_1.wrap(function _callee3$(_context3) {
1315
1339
  while (1) {
1316
- switch (_context2.prev = _context2.next) {
1340
+ switch (_context3.prev = _context3.next) {
1317
1341
  case 0:
1318
- return _context2.abrupt("return", getBlockTimestamp(provider, blockNumber));
1342
+ return _context3.abrupt("return", getBlockTimestamp(provider, blockNumber));
1319
1343
 
1320
1344
  case 1:
1321
1345
  case "end":
1322
- return _context2.stop();
1346
+ return _context3.stop();
1323
1347
  }
1324
1348
  }
1325
- }, _callee2);
1349
+ }, _callee3);
1326
1350
  }));
1327
1351
 
1328
- return function (_x9) {
1352
+ return function (_x10) {
1329
1353
  return _ref.apply(this, arguments);
1330
1354
  };
1331
1355
  }());
1332
- _context3.t0 = results;
1333
- _context3.next = 9;
1356
+ _context4.t0 = results;
1357
+ _context4.next = 9;
1334
1358
  return Promise.all(promises);
1335
1359
 
1336
1360
  case 9:
1337
- _context3.t1 = _context3.sent;
1338
- results = _context3.t0.concat.call(_context3.t0, _context3.t1);
1361
+ _context4.t1 = _context4.sent;
1362
+ results = _context4.t0.concat.call(_context4.t0, _context4.t1);
1339
1363
 
1340
1364
  case 11:
1341
1365
  i += CHUNK_SIZE;
1342
- _context3.next = 3;
1366
+ _context4.next = 3;
1343
1367
  break;
1344
1368
 
1345
1369
  case 14:
1346
- return _context3.abrupt("return", results);
1370
+ return _context4.abrupt("return", results);
1347
1371
 
1348
1372
  case 15:
1349
1373
  case "end":
1350
- return _context3.stop();
1374
+ return _context4.stop();
1351
1375
  }
1352
1376
  }
1353
- }, _callee3);
1377
+ }, _callee4);
1354
1378
  }));
1355
1379
  return _getBlocksTimestampViaRPC.apply(this, arguments);
1356
1380
  }
1357
1381
 
1358
- function getBlocksTimestamp(_x5, _x6) {
1382
+ function getBlocksTimestamp(_x6, _x7) {
1359
1383
  return _getBlocksTimestamp.apply(this, arguments);
1360
1384
  }
1361
1385
  /**
@@ -1368,18 +1392,18 @@ function getBlocksTimestamp(_x5, _x6) {
1368
1392
  */
1369
1393
 
1370
1394
  function _getBlocksTimestamp() {
1371
- _getBlocksTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(provider, blockNumbers) {
1395
+ _getBlocksTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(provider, blockNumbers) {
1372
1396
  var CHUNK_SIZE, promises, lines, i, query, results, missingBlocks, missingBlocksTimestamps;
1373
- return runtime_1.wrap(function _callee4$(_context4) {
1397
+ return runtime_1.wrap(function _callee5$(_context5) {
1374
1398
  while (1) {
1375
- switch (_context4.prev = _context4.next) {
1399
+ switch (_context5.prev = _context5.next) {
1376
1400
  case 0:
1377
1401
  if (!(blockNumbers.length == 0)) {
1378
- _context4.next = 2;
1402
+ _context5.next = 2;
1379
1403
  break;
1380
1404
  }
1381
1405
 
1382
- return _context4.abrupt("return", []);
1406
+ return _context5.abrupt("return", []);
1383
1407
 
1384
1408
  case 2:
1385
1409
  CHUNK_SIZE = 100; // graphql query limit
@@ -1395,11 +1419,11 @@ function _getBlocksTimestamp() {
1395
1419
  } // merge all the json objects
1396
1420
 
1397
1421
 
1398
- _context4.next = 8;
1422
+ _context5.next = 8;
1399
1423
  return Promise.all(promises);
1400
1424
 
1401
1425
  case 8:
1402
- results = _context4.sent.reduce(function (acc, cur) {
1426
+ results = _context5.sent.reduce(function (acc, cur) {
1403
1427
  return _extends({}, acc, cur);
1404
1428
  });
1405
1429
  missingBlocks = blockNumbers.filter(function (blockNumber) {
@@ -1410,71 +1434,71 @@ function _getBlocksTimestamp() {
1410
1434
  devLog("These blocks are missing from Aurora GraphQL endpoint: " + missingBlocks.join(', '));
1411
1435
  }
1412
1436
 
1413
- _context4.next = 13;
1437
+ _context5.next = 13;
1414
1438
  return getBlocksTimestampViaRPC(provider, missingBlocks);
1415
1439
 
1416
1440
  case 13:
1417
- missingBlocksTimestamps = _context4.sent;
1441
+ missingBlocksTimestamps = _context5.sent;
1418
1442
  missingBlocksTimestamps.forEach(function (timestamp, index) {
1419
1443
  results["b" + missingBlocks[index]] = {
1420
1444
  timestamp: new Date(timestamp * 1000).toISOString()
1421
1445
  };
1422
1446
  });
1423
- return _context4.abrupt("return", blockNumbers.map(function (blockNumber) {
1447
+ return _context5.abrupt("return", blockNumbers.map(function (blockNumber) {
1424
1448
  return Math.trunc(new Date(results["b" + blockNumber].timestamp).getTime() / 1000);
1425
1449
  }));
1426
1450
 
1427
1451
  case 16:
1428
1452
  case "end":
1429
- return _context4.stop();
1453
+ return _context5.stop();
1430
1454
  }
1431
1455
  }
1432
- }, _callee4);
1456
+ }, _callee5);
1433
1457
  }));
1434
1458
  return _getBlocksTimestamp.apply(this, arguments);
1435
1459
  }
1436
1460
 
1437
- function getBlockBeforeTimestamp(_x7, _x8) {
1461
+ function getBlockBeforeTimestamp(_x8, _x9) {
1438
1462
  return _getBlockBeforeTimestamp.apply(this, arguments);
1439
1463
  }
1440
1464
 
1441
1465
  function _getBlockBeforeTimestamp() {
1442
- _getBlockBeforeTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(provider, timestamp) {
1466
+ _getBlockBeforeTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(provider, timestamp) {
1443
1467
  var result;
1444
- return runtime_1.wrap(function _callee5$(_context5) {
1468
+ return runtime_1.wrap(function _callee6$(_context6) {
1445
1469
  while (1) {
1446
- switch (_context5.prev = _context5.next) {
1470
+ switch (_context6.prev = _context6.next) {
1447
1471
  case 0:
1448
- _context5.next = 2;
1472
+ _context6.next = 2;
1449
1473
  return getQuery('block', 'getblocknobytime', {
1450
1474
  timestamp: timestamp,
1451
1475
  closest: 'before'
1452
1476
  });
1453
1477
 
1454
1478
  case 2:
1455
- result = _context5.sent;
1456
- _context5.t0 = parseInt(result);
1479
+ result = _context6.sent;
1480
+ _context6.t0 = parseInt(result);
1457
1481
 
1458
- if (_context5.t0) {
1459
- _context5.next = 8;
1482
+ if (_context6.t0) {
1483
+ _context6.next = 8;
1460
1484
  break;
1461
1485
  }
1462
1486
 
1463
- _context5.next = 7;
1487
+ _context6.next = 7;
1464
1488
  return provider.getBlockNumber();
1465
1489
 
1466
1490
  case 7:
1467
- _context5.t0 = _context5.sent;
1491
+ _context6.t0 = _context6.sent;
1468
1492
 
1469
1493
  case 8:
1470
- return _context5.abrupt("return", _context5.t0);
1494
+ return _context6.abrupt("return", _context6.t0);
1471
1495
 
1472
1496
  case 9:
1473
1497
  case "end":
1474
- return _context5.stop();
1498
+ return _context6.stop();
1475
1499
  }
1476
1500
  }
1477
- }, _callee5);
1501
+ }, _callee6);
1478
1502
  }));
1479
1503
  return _getBlockBeforeTimestamp.apply(this, arguments);
1480
1504
  }
@@ -1768,21 +1792,23 @@ var dummyUserMarketDetails = {
1768
1792
  };
1769
1793
  var referralRewardDummy1 = {
1770
1794
  campaign: 'testa',
1771
- startTime: 1652882400,
1772
- endTime: 1653573599,
1795
+ startTime: /*#__PURE__*/Math.trunc( /*#__PURE__*/new Date(2022, 8, 1).getTime() / 1000),
1796
+ endTime: /*#__PURE__*/Math.trunc( /*#__PURE__*/new Date(2022, 9, 30).getTime() / 1000),
1773
1797
  isReferrer: false,
1774
1798
  rewardTokenAmount: dummyTokenAmount,
1775
1799
  transactionHash: null,
1776
- userAddr: '0x...123'
1800
+ userAddr: '0x...123',
1801
+ refereeAddress: '0x123..123'
1777
1802
  };
1778
1803
  var referralRewardDummy2 = {
1779
1804
  campaign: 'testb',
1780
- startTime: 1652882400,
1781
- endTime: 1653573599,
1805
+ startTime: /*#__PURE__*/Math.trunc( /*#__PURE__*/new Date(2022, 8, 1).getTime() / 1000),
1806
+ endTime: /*#__PURE__*/Math.trunc( /*#__PURE__*/new Date(2022, 8, 31).getTime() / 1000),
1782
1807
  isReferrer: true,
1783
1808
  rewardTokenAmount: dummyTokenAmount2,
1784
1809
  transactionHash: '0x4da9657663b46ef18d150b897b28c7b717f16421978b52e3a06d91b54ca3548b',
1785
- userAddr: '0x...456'
1810
+ userAddr: '0x...456',
1811
+ refereeAddress: '0x123..123'
1786
1812
  };
1787
1813
 
1788
1814
  var AURIGAMI_API_END_POINT = 'https://api.aurigami.finance/app/';
@@ -2602,6 +2628,7 @@ var helpers = {
2602
2628
  decimalFactor: decimalFactor,
2603
2629
  isSameAddress: isSameAddress,
2604
2630
  getCurrentTimestamp: getCurrentTimestamp,
2631
+ sleep: sleep,
2605
2632
  validateAndParseAddress: validateAndParseAddress,
2606
2633
  getDecimal: getDecimal,
2607
2634
  getSymbol: getSymbol,
@@ -4839,16 +4866,48 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4839
4866
  var _getPlyGameResultsInTransaction = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(txHash) {
4840
4867
  var _this3 = this;
4841
4868
 
4842
- var tx, filter, betMadeEvents;
4869
+ var tx, i, filter, betMadeEvents;
4843
4870
  return runtime_1.wrap(function _callee5$(_context5) {
4844
4871
  while (1) {
4845
4872
  switch (_context5.prev = _context5.next) {
4846
4873
  case 0:
4847
4874
  _context5.next = 2;
4848
- return this._networkConnection.provider.waitForTransaction(txHash, 1);
4875
+ return this._networkConnection.provider.getTransactionReceipt(txHash);
4849
4876
 
4850
4877
  case 2:
4851
4878
  tx = _context5.sent;
4879
+ i = 0;
4880
+
4881
+ case 4:
4882
+ if (!(i < 100 && !tx)) {
4883
+ _context5.next = 13;
4884
+ break;
4885
+ }
4886
+
4887
+ _context5.next = 7;
4888
+ return sleep(1000);
4889
+
4890
+ case 7:
4891
+ _context5.next = 9;
4892
+ return this._networkConnection.provider.getTransactionReceipt(txHash);
4893
+
4894
+ case 9:
4895
+ tx = _context5.sent;
4896
+
4897
+ case 10:
4898
+ i++;
4899
+ _context5.next = 4;
4900
+ break;
4901
+
4902
+ case 13:
4903
+ if (tx) {
4904
+ _context5.next = 15;
4905
+ break;
4906
+ }
4907
+
4908
+ throw new Error("Transaction " + txHash + " takes too long to be mined");
4909
+
4910
+ case 15:
4852
4911
  filter = this.env.plygame.filters.BetMade();
4853
4912
  betMadeEvents = tx.logs.filter(function (log) {
4854
4913
  return isSameAddress(log.topics[0], filter.topics[0]);
@@ -4862,7 +4921,7 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4862
4921
  return _this3.parseBetMakeEvent(e);
4863
4922
  })));
4864
4923
 
4865
- case 6:
4924
+ case 18:
4866
4925
  case "end":
4867
4926
  return _context5.stop();
4868
4927
  }
@@ -5219,12 +5278,14 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5219
5278
  rewardTokenAmount: TokenAmount.fromAddressAndAmount(item.token, item.amount),
5220
5279
  startTime: REFERRAL_CAMPAIGNS[item.campaign].start,
5221
5280
  endTime: REFERRAL_CAMPAIGNS[item.campaign].end,
5222
- transactionHash: (_item$transactionHash = item.transactionHash) != null ? _item$transactionHash : null
5281
+ transactionHash: (_item$transactionHash = item.transactionHash) != null ? _item$transactionHash : null,
5282
+ refereeAddress: null
5223
5283
  };
5224
5284
  });
5285
+ items = [referralRewardDummy1, referralRewardDummy2].concat(items);
5225
5286
  return _context5.abrupt("return", items);
5226
5287
 
5227
- case 5:
5288
+ case 6:
5228
5289
  case "end":
5229
5290
  return _context5.stop();
5230
5291
  }
@@ -5267,7 +5328,8 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5267
5328
  rewardTokenAmount: TokenAmount.fromAddressAndAmount(item.token, item.amount),
5268
5329
  startTime: REFERRAL_CAMPAIGNS[item.campaign].start,
5269
5330
  endTime: REFERRAL_CAMPAIGNS[item.campaign].end,
5270
- transactionHash: null
5331
+ transactionHash: null,
5332
+ refereeAddress: null
5271
5333
  };
5272
5334
  });
5273
5335
  items.sort(function (a, b) {
@@ -5288,6 +5350,84 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5288
5350
  }
5289
5351
 
5290
5352
  return leaderboard;
5353
+ }()
5354
+ /**
5355
+ * current number of slots under a referral code being used that exceed minimum deposit amount
5356
+ */
5357
+ ;
5358
+
5359
+ _proto.slotsInUse =
5360
+ /*#__PURE__*/
5361
+ function () {
5362
+ var _slotsInUse = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(referralCode) {
5363
+ return runtime_1.wrap(function _callee7$(_context7) {
5364
+ while (1) {
5365
+ switch (_context7.prev = _context7.next) {
5366
+ case 0:
5367
+ return _context7.abrupt("return", 123);
5368
+
5369
+ case 1:
5370
+ case "end":
5371
+ return _context7.stop();
5372
+ }
5373
+ }
5374
+ }, _callee7);
5375
+ }));
5376
+
5377
+ function slotsInUse(_x7) {
5378
+ return _slotsInUse.apply(this, arguments);
5379
+ }
5380
+
5381
+ return slotsInUse;
5382
+ }();
5383
+
5384
+ _proto.totalReferralSlots = function totalReferralSlots() {
5385
+ return 500;
5386
+ }
5387
+ /**
5388
+ * a way to determine qualification status of a user. null if not referred yet,
5389
+ * qualified if referred + min deposit, notQualified if referred + min deposit
5390
+ * not reached or withdrew too early
5391
+ */
5392
+ ;
5393
+
5394
+ _proto.userReferralStatus =
5395
+ /*#__PURE__*/
5396
+ function () {
5397
+ var _userReferralStatus = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(userAddr) {
5398
+ return runtime_1.wrap(function _callee8$(_context8) {
5399
+ while (1) {
5400
+ switch (_context8.prev = _context8.next) {
5401
+ case 0:
5402
+ _context8.next = 2;
5403
+ return this.getReferralCodeUsed(userAddr);
5404
+
5405
+ case 2:
5406
+ _context8.t0 = _context8.sent;
5407
+
5408
+ if (!(_context8.t0 !== '')) {
5409
+ _context8.next = 7;
5410
+ break;
5411
+ }
5412
+
5413
+ return _context8.abrupt("return", 'notQualified');
5414
+
5415
+ case 7:
5416
+ return _context8.abrupt("return", 'notReferred');
5417
+
5418
+ case 8:
5419
+ case "end":
5420
+ return _context8.stop();
5421
+ }
5422
+ }
5423
+ }, _callee8, this);
5424
+ }));
5425
+
5426
+ function userReferralStatus(_x8) {
5427
+ return _userReferralStatus.apply(this, arguments);
5428
+ }
5429
+
5430
+ return userReferralStatus;
5291
5431
  }();
5292
5432
 
5293
5433
  return ReferralRead;
@@ -5309,21 +5449,21 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5309
5449
  _proto2.registerNewReferralCode =
5310
5450
  /*#__PURE__*/
5311
5451
  function () {
5312
- var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
5452
+ var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
5313
5453
  var referralCode;
5314
- return runtime_1.wrap(function _callee7$(_context7) {
5454
+ return runtime_1.wrap(function _callee9$(_context9) {
5315
5455
  while (1) {
5316
- switch (_context7.prev = _context7.next) {
5456
+ switch (_context9.prev = _context9.next) {
5317
5457
  case 0:
5318
5458
  referralCode = ethers.ethers.utils.formatBytes32String(this.generateReferralCode());
5319
- return _context7.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerNewUserReferralCode(referralCode));
5459
+ return _context9.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerNewUserReferralCode(referralCode));
5320
5460
 
5321
5461
  case 2:
5322
5462
  case "end":
5323
- return _context7.stop();
5463
+ return _context9.stop();
5324
5464
  }
5325
5465
  }
5326
- }, _callee7, this);
5466
+ }, _callee9, this);
5327
5467
  }));
5328
5468
 
5329
5469
  function registerNewReferralCode() {
@@ -5340,24 +5480,24 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5340
5480
  _proto2.useReferralCode =
5341
5481
  /*#__PURE__*/
5342
5482
  function () {
5343
- var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(code) {
5483
+ var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(code) {
5344
5484
  var referralCode;
5345
- return runtime_1.wrap(function _callee8$(_context8) {
5485
+ return runtime_1.wrap(function _callee10$(_context10) {
5346
5486
  while (1) {
5347
- switch (_context8.prev = _context8.next) {
5487
+ switch (_context10.prev = _context10.next) {
5348
5488
  case 0:
5349
5489
  referralCode = ethers.ethers.utils.formatBytes32String(code);
5350
- return _context8.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerReferralCodeUsed(referralCode));
5490
+ return _context10.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerReferralCodeUsed(referralCode));
5351
5491
 
5352
5492
  case 2:
5353
5493
  case "end":
5354
- return _context8.stop();
5494
+ return _context10.stop();
5355
5495
  }
5356
5496
  }
5357
- }, _callee8, this);
5497
+ }, _callee10, this);
5358
5498
  }));
5359
5499
 
5360
- function useReferralCode(_x7) {
5500
+ function useReferralCode(_x9) {
5361
5501
  return _useReferralCode.apply(this, arguments);
5362
5502
  }
5363
5503
 
@@ -5371,23 +5511,23 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5371
5511
  _proto2.claimReferralRewards =
5372
5512
  /*#__PURE__*/
5373
5513
  function () {
5374
- var _claimReferralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
5514
+ var _claimReferralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
5375
5515
  var unclaimedRewards, campaigns, tokens;
5376
- return runtime_1.wrap(function _callee9$(_context9) {
5516
+ return runtime_1.wrap(function _callee11$(_context11) {
5377
5517
  while (1) {
5378
- switch (_context9.prev = _context9.next) {
5518
+ switch (_context11.prev = _context11.next) {
5379
5519
  case 0:
5380
- _context9.t0 = this;
5381
- _context9.next = 3;
5520
+ _context11.t0 = this;
5521
+ _context11.next = 3;
5382
5522
  return this._networkConnection.signer.getAddress();
5383
5523
 
5384
5524
  case 3:
5385
- _context9.t1 = _context9.sent;
5386
- _context9.next = 6;
5387
- return _context9.t0.referralRewards.call(_context9.t0, _context9.t1);
5525
+ _context11.t1 = _context11.sent;
5526
+ _context11.next = 6;
5527
+ return _context11.t0.referralRewards.call(_context11.t0, _context11.t1);
5388
5528
 
5389
5529
  case 6:
5390
- unclaimedRewards = _context9.sent.filter(function (reward) {
5530
+ unclaimedRewards = _context11.sent.filter(function (reward) {
5391
5531
  return reward.transactionHash == null;
5392
5532
  });
5393
5533
  campaigns = unclaimedRewards.map(function (reward) {
@@ -5396,14 +5536,14 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5396
5536
  tokens = unclaimedRewards.map(function (reward) {
5397
5537
  return reward.rewardTokenAmount.token.address;
5398
5538
  });
5399
- return _context9.abrupt("return", new AirdropReadWrite(this._networkConnection).redeemMultiple(campaigns, tokens));
5539
+ return _context11.abrupt("return", new AirdropReadWrite(this._networkConnection).redeemMultiple(campaigns, tokens));
5400
5540
 
5401
5541
  case 10:
5402
5542
  case "end":
5403
- return _context9.stop();
5543
+ return _context11.stop();
5404
5544
  }
5405
5545
  }
5406
- }, _callee9, this);
5546
+ }, _callee11, this);
5407
5547
  }));
5408
5548
 
5409
5549
  function claimReferralRewards() {
@@ -5911,6 +6051,7 @@ exports.networkAddresses = networkAddresses;
5911
6051
  exports.queryGraphQL = queryGraphQL;
5912
6052
  exports.referralRewardDummy1 = referralRewardDummy1;
5913
6053
  exports.referralRewardDummy2 = referralRewardDummy2;
6054
+ exports.sleep = sleep;
5914
6055
  exports.sortEvents = sortEvents;
5915
6056
  exports.symbolRecords = symbolRecords;
5916
6057
  exports.validateAndParseAddress = validateAndParseAddress;